Laravel Work Flow Project Creation
Project creation
sh# laravel version n<8 composer create-project laravel/laravel <project-name> # laravel version 9 laravel new <project-name>Controllers
- working in controller folder
- contains the function and the controller backend of the server
sh# plain controller php artisan make:controller <controller-name> # resource controller with CRUD functions php artisan make:controller <controller-name> -rRouting modifying files in route folder. ex. web.php, api.php, etc
php# Specific Route Route::<method>('/<route>',[<controllerClass>::class,'<function-name>']); # Resource Route Route::resource('/<route>',<controllerClass>::class);Modeling handling models
php# adding fillable to the Model class you generate protected $fillable = [ 'id' ...add field here... ];Database Configuration and migration
- modifying .env
- create migration
sh#ex. php artisan make:migration create_activities_table php artisan make:migration <migration-name>Run Server
running php laravel web project.
shphp artisan serve