A static page is called that in which the information that is there is in the name of every user. You cannot change anything in a static page. It is only used to see information.
Dynamic website:-
Dynamic website is user-friendly, user can interact with it. The page in which the user can interact is called a dynamic website. Like submitting a form by filling in a web page. In this, each user gives different information, the user who enters the information gets the same result.
How PHP works?
There is a client who sends a request or works to visit a website.
web server
The webserver provides us this facility which will be there for 24 hours. So that your client will be able to send that request by any time difference and its corresponding web server will be able to respond to it. A server will run in the webserver which you call Apache server.
This is the web server, this is your small storage in which you have a database created. In which your own server is running which supports PHP. As a programmer, whatever site he has developed is the content of the whole site or is it accessories, They give way by storing them in their web server. You will also create a database so that the user can access it anytime.
If you have to run the PHP file in the local server, then first you have to open the XAMMP control panel, then you have to open apache and MySQL in it, this is the first thing. After that you have to go to this puck, then where you have saved the XAMMP file, you have to open the sump file, after that you have to open the htdos. After that you have to go to this PC, then open the file where you have saved XAMPP. After that htdcos has to be opened. Your project will have to create a file, all your files will be made from PHP, HTML, ccs, javascript, audio, images, videos, etc. Then go to your browser and open localhost, then type the name of your project in it and open it. After that, your PHP file will start running.
SQLSTATE[HY000]: General error: 1364 Field ‘phone’ doesn’t have a default value (SQL: insert into `products` (`name`, `email`, `address`, `image`, `updated_at`, `created_at`) values (amti, kuam@gmail.com, sdafasdf, 642917381.jpg, 2021–05–11 10:58:35, 2021–05–11 10:58:35))
When I’m submit form then got General error field doesn’t have default value. let’s go to solve this.
👉 1 step go to your database and put change none>to Null and save.
In this tutorial I’m going to describe how to add data in DataTable in laravel 8 we will create single page companies ajax crud application (SPA) using dataTables js, modal and jQuery in laravel 8.
Laravel 8 Ajax CRUD Tutorial using Datatable JS Step 1 – Download Laravel 8 App Step 2 – Database Configuration Step 3 – Installing Yajra Datatables Step 4 – Make Model & Migration Step 5 – Make Routes Step 6 – Create AJAX CRUD Datatables Controller Step 7 – Create Blade Views File companies.blade.php company-action.blade.php Step 8 – Run Development Server
Step 1 — Download Laravel 8 App
1st step Install laravel project and new setup, lets open the terminal C:\xampp\htdocs and paste below code
/* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */
Route::get('/', function () { return view('welcome'); });
use App\Http\Controllers\DataTableAjaxCRUDController;
Lets go to controller and copy below code and paste there
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request; use App\Company; class DataTableAjaxCRUDController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { if(request()->ajax()) { return datatables()->of(Company::select('*')) ->addColumn('action', 'company-action') ->rawColumns(['action']) ->addIndexColumn() ->make(true); } return view('companies'); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $companyId = $request->id;
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $where = array('id' => $request->id); $company = Company::where($where)->first();
return Response()->json($company); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $company = Company::where('id','$request->id')->delete(); return Response()->json($company); } }
Step 6 — Create Blade Views File
Create two blade views file, which is following:
companies.blade.php
Next go to companies.blade.php file and paste below code
In this tutorial I’m going to describe how to set up virtual host in Laravel. Please follow this Tutorial and you able to create successfully virtual host in Laravel
1. Go to C drive and Go to this Directory-> C:\xampp\apache\conf\extra and open httpd-vhosts name of folder
Virtual-host-in-laravel
Open this folder -> httpd-vhosts
2nd Step Copy Below Code
👇
<VirtualHost *:80>
DocumentRoot “C:/xampp/htdocs/blog/public”
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot “C:/xampp/htdocs/blog/public”
ServerName blog.co
</VirtualHost>
☝️
and paste simply there in this folder -> httpd-vhosts
3rd Step go to windows C:\Windows\System32\drivers\etc and open hosts folder
4th step simply copy this
👇
127.0.0.1 localhost
127.0.0.1 blog.co
And paste this folder
👇
After stop your xampp apache server and start then
And start then Xampp Apache server
And run blog.co now you can see blog.co localhost set up is done.
If you are trying to run Ansible Adhoc commands or playbook in Local mode, these articles will help you.
Ansible can’t run playbooks locally without ssh if ansible_connection=local is defined in the hosts file, although it can run playbooks locally without ssh with connection: local in the playbook or with flag –connection=local.
---
- name: run the playbook tasks on the localhost
hosts: 127.0.0.1
connection: local
become: yes
tasks:
- name: print out the hostname of target
command: hostname
- name: ensure aptitude is installed
command: apt-get -y install aptitude
- name: update the apt package index i.e. apt-get update
apt: update_cache=yes
- name: upgrade system packages i.e. apt-get upgrade
apt: upgrade=yes
ngrok is a free tool that allows you to expose a web server running on your local machine to the internet. It includes additional functionality that makes it easy to install and manage itself as a native operating system service on Windows, OS X and Linux.
It is is a multiplatform tunnelling, reverse proxy software that establishes secure tunnels from a public endpoint such as internet to a locally running network service while capturing all traffic for detailed inspection and replay.
The following are the issues that we were facing before Ngrok deployment:
Unable to expose localhost application directly to internet without DMZ & other network configuration
Unable to demonstrate an application to Client on urgent basis
Unable to share websites for testing purpose
Develop any services which consume Webhooks (HTTP CallBacks)
Can’t share a website temporarily that is running only on our developer machine
Time Consuming on network and DNS configurations
Can’t debug or inspect HTTP Traffic in a precise manner
Can’t run networked services on machines that are firewalled off from the internet
Unable to expose application behind http proxy
Unable to forward non-http and non-local network services
It’s really easy to install and use
ngrok is built in Go so it is packaged as binaries for each major platform. To install ngrok do the following:
Download the package for your system
Unzip the package
There is no step 3!
Once you have ngrok installed, using it to tunnel to an application running on, say, port 3000 is as easy as:
$ ./ngrok http 3000
Once you’ve unzipped the ngrok executable move it to a folder that’s in your $PATH then you can run ngrok from anywhere you want on the command line by just typing: