Here's a full list of commonly used Artisan commands in Laravel (as of Laravel 12). Artisan is Laravel’s powerful CLI tool to help with development tasks like code generation, database management, queue handling, etc.
Command | Description |
---|---|
php artisan list | Show all available commands |
php artisan help <command> | Show help for a specific command |
php artisan inspire | Display an inspirational quote |
php artisan about | Show Laravel version & environment info |
Command | Description |
---|---|
php artisan config:cache | Cache the config files |
php artisan config:clear | Clear the config cache |
php artisan env | Display the current environment |
php artisan optimize | Optimize framework for better performance |
php artisan route:cache | Cache routes |
php artisan route:clear | Clear route cache |
php artisan view:cache | Compile all Blade templates |
php artisan view:clear | Clear compiled Blade views |
Command | Description |
---|---|
php artisan make:controller | Create a controller |
php artisan make:model | Create a model |
php artisan make:migration | Create a new migration file |
php artisan make:seeder | Create a database seeder |
php artisan make:factory | Create a model factory |
php artisan make:middleware | Create middleware |
php artisan make:request | Create a form request class |
php artisan make:command | Create a custom Artisan command |
php artisan make:job | Create a queued job |
php artisan make:event | Create an event |
php artisan make:listener | Create an event listener |
php artisan make:policy | Create a policy class |
php artisan make:resource | Create a JSON API resource |
php artisan make:test | Create a test class |
php artisan make:mail | Create a Mailable class |
php artisan make:notification | Create a Notification class |
php artisan make:provider | Create a service provider |
Command | Description |
---|---|
php artisan migrate | Run all outstanding migrations |
php artisan migrate:rollback | Roll back the last batch of migrations |
php artisan migrate:refresh | Rollback and re-run all migrations |
php artisan migrate:fresh | Drop all tables and re-run migrations |
php artisan db:seed | Run database seeders |
php artisan migrate:status | View the status of each migration |
php artisan schema:dump | Dump the current database schema |
Command | Description |
---|---|
php artisan test | Run feature/unit tests |
php artisan dusk | Run Laravel Dusk browser tests (if installed) |
Command | Description |
---|---|
php artisan queue:work | Start processing jobs |
php artisan queue:listen | Listen to the queue continuously |
php artisan queue:restart | Restart all queue workers |
php artisan queue:retry | Retry failed jobs |
php artisan queue:failed | View failed jobs |
php artisan queue:flush | Flush all failed jobs |
php artisan queue:table | Generate migration for jobs table |
Command | Description |
---|---|
php artisan make:policy | Create a new policy |
php artisan make:rule | Create a custom validation rule |
Command | Description |
---|---|
php artisan route:list | Show all registered routes |
php artisan route:cache | Cache routes for faster performance |
php artisan route:clear | Clear the route cache |
Command | Description |
---|---|
php artisan cache:clear | Clear the application cache |
php artisan cache:forget | Remove an item from cache store |
php artisan config:cache | Cache the config |
php artisan down | Put the app in maintenance mode |
php artisan up | Bring the app out of maintenance |
Command | Description |
---|---|
php artisan serve | Start a local dev server (localhost:8000) |
php artisan storage:link | Create symbolic link to /public/storage |
php artisan event:cache | Cache all events and listeners |
php artisan event:clear | Clear the cached events and listeners |