A project on how to perform create, read, update, delete actions with a database.
- Create Laravel app files:
composer create-project laravel/laravel <project-name>
- Create database and configure environment
Create a database and configure the data base on the
.env
file
- Prepare database migration classes for the target table.
php artisan make:migration create_<table-name>_table
. It will create a PHP Laravel migration class in the database/migrations path
-
Migrate the schema into the database This creates tables into the database.
php artisan migrate
-
Start the server
php artisan serve
-
Create Laravel model
php artisan make:model NameOfModel
This will create the following Model class into theapp/Model
directory -
Create Laravel app controller
php artisan make:controller NameOfController
-
Build layouts