Laravel

Must Know Laravel Artisan Commands

March 3, 2018

author:

Must Know Laravel Artisan Commands

Artisan console is one of integral parts of Laravel Framework. It is a command line tool to run Laravel commands. These commands improve the development speed by providing ready to use scaffolding and required methods. Thus it becomes essential for an expert developer to remember frequently used commands. Such commands are listed below:

Display this application version in Laravel:

php artisan --version OR -V

Regenerate framework autoload files in Laravel:

php artisan dump-autoload

Lists artisan commands in Laravel:

php artisan list

Serve Laravel Application on the PHP Development Server:

php artisan serve

Interact with the Laravel Application:

php artisan tinker

Publish a package’s assets to the public directory:

php artisan asset:publish [--bench[="vendor/package"]] [--path[="..."]] [package]

Set the Laravel Application Key:

php artisan key:generate

Laravel Database migrations:

php artisan migrate

Create a new resourceful controller in Laravel:

php artisan controller:make [--bench="vendor/package"]

Generate database migration along with model in Laravel:

php artisan make:model User --migration OR -m

Generate database seeder in Laravel:

php artisan make:seeder [Table Seeder]

Create new middleware in Laravel:

Make:middleware [Middleware name]

Lists active routes in Laravel Application:

Route:list

Create symbolic link in Laravel:

Create symbolic link from public/storage to storage/app/public

Storage:link

Flush the Laravel Application cache:

php artisan cache:clear

Conclusion:

In this post we took a to the point look on some of the lesser used yet important laravel commands. At times, we tend to know the command but forget syntax. So you can copy-paste the relevant command directly from here and use it.

QUESTIONS & COMMENTS:

Thanks for reading. In this post we discussed some of the important laravel commands that are often used but rarely remembered. Though I tried to cover them, if you think I’ve missed any utility laravel command, drop them in the comment section below..

Leave a comment

Your email address will not be published. Required fields are marked *