artisan down
Puts your application in maintenance mode and returns a 503 holding page.
php artisan down
copy
Puts your application in maintenance mode and returns a 503 holding page.
php artisan down
copy
Turns off the maintenance mode and puts your application back online.
php artisan up
copy
This command will cache configuration file to improve application performance.
php artisan config:cache
copy
Flush the application cache.
php artisan cache:clear
copy
Clears configuration file cache.
php artisan config:clear
copy
Count method returns a number of records in the queried object.
App\Users::count();
copy
Seeds the database with records.
php artisan db:seed
copy
Show the information about a command.
php artisan help [command]
copy
Check version of the installed Laravel instance.
php artisan --version
copy
Print a full list of Artisan commands with descriptions.
php artisan
copy
This artisan command will list all routes registered in your application.
php artisan route:list
copy
Puts the application into maintenance mode.
php artisan down
copy
Depending on Laravel version installed you can add auth functionality to your app using the following commands. Make sure you have a database configured and connected for this step as it will be needed to create a user table.
// Laravel version < 6
php artisan make:auth
// Laravel verions >= 6
composer require laravel/ui
php artisan ui vue --auth
php artisan migrate
copy
Creates a new Controller class. Naming convention - use a plural form of the element i.e. "Items" followed by the "Controller".
php artisan make:controller ItemsController
copy
Creates a new Controller class. "-r" flag creates all default route actions in the new Controller - index, show, create, store, edit, update and destroy. "-m" flag will create the Model file too.
php artisan make:controller ItemsController -r -m
copy
Creates a new Event class.
php artisan make:event ItemWasAdded
copy
Creates a new Factory class for a specified Model.
php artisan make:factory ItemFactory -m Item
copy
Creates a new Listener class. The --event flag, or -e in short, will include the event to listen for.
php artisan make:event SendItemAddedNotification --event=ItemAdded
copy
Creates a new Mail class. The --markdown flag, or -m in short, will also create a Markdown template for the new email.
php artisan make:mail ItemConfirmation --markdown="emails.item-confirmation"
copy
Creates a new migration class.
php artisan make:migration create_items_table
copy
Creates a new Notification class.
php artisan make:notification UserEmailUpdated
copy
Creates a new Seeder class for a specified table.
php artisan make:seeder ItemsTableSeeder
copy
Runs all database migrations.
php artisan migrate
copy
Runs a clean database migration. WARNING! This command will wipe the database clean and rebuild all tables from scratch so it should never be run in the production application!
php artisan migrate:fresh
copy
Revert migration one step. By appending a --step=x flag you can define the number of steps to rollback.
php artisan migrate:rollback
copy
Serve command runs the development server for your Laravel project.
php artisan serve
copy
Tinker allows you to interact with the Laravel project directly from the command line interface.
php artisan tinker
copy
Puts the application into active mode.
php artisan up
copy