CRUD JQuery Ajax MySQL PhpStorm
Description
Laravel CRUD (create retrieve update delete) with jQuery Ajax MySQL PhpStorm It is easy and complete video tutorial for beginners. Step by step designed in Ph
Laravel CRUD Operations
In this tutorial we are going to initiate Laravel CRUD operations project for learning.
Note: Before you start install laravel you need to install composer package installer in your system. Follow the steps.
Step 1: Composer Installation
To Install composer in your system click here
Step 2: Create new project via Composer
For creating a new project via a composer. you need to run a command in command line console or terminal.
cmd: composer create-project --prefer-dist laravel/laravel mysite
Note: You will see list of directories where you run above command. let's discuss most important directories.
- app - this directory contains list of models, http > controllers directory. This is a important directory where you write a controller and model.
- public - this directory contains assets like Image files, CSS files, Script files.
- resources - this directory contains views.
- routes - this directory contains all routes. Routes for specific URL.
- .env - this file contains configuration for database.
Step 3: Start a local server
There is also command for starting a server.
cmd: php artisan serve
Step 3: Create database
- Create database with name of crud.
- Create database table books.
Step 4: Set Connection with database
- Set the database name like crud
- Set the username like root
- Set the password if there is.
filename: .env
Step 5: Create Controller
- define a function for getting welcome file.
- define a function for save or update a book model.
- define a function to retrieve list of books.
- define a method to delete a book.
filename: Controller.php
Step 6: Create a view
- create a view for showing data table and form for input.
- add jQuery for manipulation of adding, deleting and showing data in view.
filename: welcome.blade.php
Step 7: Finally update Route web.php and api.php
- update web.php file for getting main view to display.
- update api.php file for api level operations.
filename: web.php
filename: api.php
Note: If do you need help for developing and creating this application, please comment blow so that we may reach you or reply you as asap.