Artisan Commands in Laravel

AuthorSumit Dey Sarkar

Pubish Date22 Mar 2023


In this tutorial we will learn artisan commands in Laravel.


Artisan commands in laravel

In Laravel, artisan is the command-line interface included with the framework. Artisan provides a number of helpful commands for managing your Laravel application.


Here are some of the most commonly used artisan commands:

1) php artisan serve - Start the development server.


2) php artisan make:model ModelName - Create a new Eloquent model.


3) php artisan make:controller ControllerName - Create a new controller.


4) php artisan make:migration create_table_name - Create a new database migration.


5) php artisan migrate - Run all outstanding database migrations.


6) php artisan tinker - Start the Laravel REPL.


7) php artisan route:list - List all registered routes.


8) php artisan make:middleware MiddlewareName - Create a new middleware.


9) php artisan cache:clear - Clear the application cache.


10) php artisan make:seeder SeederName - Create a new database seeder.


11) php artisan db:seed - Seed the database with records.


12) php artisan make:auth - Scaffold basic login and registration views and routes.


13) php artisan make:middleware MiddlewareName - Create a new middleware class.


14) php artisan make:request RequestName - Create a new form request class.


15) php artisan make:provider ProviderName - Create a new service provider.


16) php artisan make:job JobName - Create a new job class.


17) php artisan make:event EventName - Create a new event class.


18) php artisan make:listener ListenerName --event=EventName - Create a new event listener class.


19) php artisan make:mail MailName - Create a new email class.


20) php artisan make:notification NotificationName - Create a new notification class.


21) php artisan queue:work - Start processing jobs on the queue.


22) php artisan queue:listen - Listen to the queue and process jobs as they become available.


23) php artisan storage:link - Create a symbolic link from public/storage to storage/app/public.


24) php artisan make:test TestName - Create a new test class.


25) php artisan optimize - Optimize the application for faster performance.


26) php artisan config:cache - Cache the configuration files for faster performance.


27) php artisan view:clear - Clear the compiled views.


28) php artisan down - Put the application into maintenance mode.


29) php artisan up - Take the application out of maintenance mode.

Comments 0

Leave a comment