Puts your application in maintenance mode and returns a 503 holding page.

#artisan#php
php artisan down
copy

Turns off the maintenance mode and puts your application back online.

#artisan#php
php artisan up
copy

This command will cache configuration file to improve application performance.

#artisan#php#cache
php artisan config:cache
copy

Flush the application cache.

#artisan#php#cache
php artisan cache:clear
copy

Clears configuration file cache.

#artisan#php#cache
php artisan config:clear
copy

Count method returns a number of records in the queried object.

#artisan#php
App\Users::count();
copy

Seeds the database with records.

#artisan#php#db
php artisan db:seed
copy

Show the information about a command.

#artisan#php
php artisan help [command]
copy

Check version of the installed Laravel instance.

#artisan#php
php artisan --version
copy

Print a full list of Artisan commands with descriptions.

#artisan#php
php artisan
copy

This artisan command will list all routes registered in your application.

#artisan#php#route
php artisan route:list
copy

Puts the application into maintenance mode.

#artisan#php
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.

#artisan#php#make#auth
// 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".

#artisan#php#make#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.

#artisan#php#make#controller
php artisan make:controller ItemsController -r -m
copy

Creates a new Event class.

#artisan#php#make#event
php artisan make:event ItemWasAdded
copy

Creates a new Factory class for a specified Model.

#artisan#php#make#factory
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.

#artisan#php#make#listener
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.

#artisan#php#make#mail
php artisan make:mail ItemConfirmation --markdown="emails.item-confirmation"
copy

Creates a new migration class.

#artisan#php#make#migration
php artisan make:migration create_items_table
copy

Creates a new Notification class.

#artisan#php#make#notification
php artisan make:notification UserEmailUpdated
copy

Creates a new Seeder class for a specified table.

#artisan#php#make#seeder
php artisan make:seeder ItemsTableSeeder
copy

Runs all database migrations.

#artisan#php#migration
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!

#artisan#php#migration
php artisan migrate:fresh
copy

Revert migration one step. By appending a --step=x flag you can define the number of steps to rollback.

#artisan#php#migration
php artisan migrate:rollback
copy

Serve command runs the development server for your Laravel project.

#artisan#php
php artisan serve
copy

Tinker allows you to interact with the Laravel project directly from the command line interface.

#artisan#php#tinker
php artisan tinker
copy

Puts the application into active mode.

#artisan#php
php artisan up
copy
NordVPN NordVPN