Cheatsheets

Laravel

CommandsDescriptions
laravel new <app_name>Will initialize npm inside your project

Artisan

CommandsDescriptions
Initialization
php artisan key:generateSets the application key.
Development
php artisan serveServe the application on the PHP development server.
Maintenance Mode
php artisan downEnables maintenance mode.
php artisan down --message="<maintenance_message>"Enables maintenance mode with message.
Eg., php artisan down --message="Upgrading Database"
php artisan down --allow=<ip>Enables maintenance mode but allows specific IP to access the application.
Eg., php artisan down --allow=127.0.0.1
php artisan upDisables maintenance mode.
Storage
php artisan storage:linkCreate a symbolic link from "public/storage" to "storage/app/public". It is used to store user-generated files, such as profile avatars, that should be publicly accessible.
Controller Generators
php artisan make:controller <ControllerName>Create a controller class.
php artisan make:controller BlogController
php artisan make:controller <ControllerName> -rGenerates a resource controller class.
php artisan make:controller BlogController -r
php artisan make:controller <ControllerName> -r -m=<Model>Generates a resource controller class route model binding.
php artisan make:controller BlogController -r -m=Blog
php artisan make:controller <ControllerName> --apiGenerates a API resource controller class that excludes the create and edit methods.
php artisan make:controller BlogController --api
Production Optimization
php artisan config:cacheThis will combine all of the configuration options for your application into a single file which will be loaded quickly by the framework. This should be part of your production deployment routine.
php artisan route:cacheCreate a route cache file for faster route registration.