Now Hiring: Are you a driven and motivated 1st Line IT Support Engineer?

Office Hours: 10:00am-6:00pm

 

Call Anytime 24/7

 

Mail Us For Support

 

Office Address

Complete List of Laravel Artisan Commands (2025 Guide)

Laravel Artisan Commands

Laravel comes with a powerful command-line interface called Artisan, which simplifies many common tasks during development. From generating models, controllers, and migrations to managing caches, queues, and testing, Artisan makes working with Laravel faster and more efficient. Whether you are a beginner learning the basics or an advanced developer optimizing workflow, understanding these commands is essential to boosting productivity and streamlining your Laravel projects.

Laravel General Artisan Commands

php artisan list        # Show all available Artisan commands
php artisan help [cmd]  # Get help for a specific command
php artisan --version   # Show Laravel version
php artisan tinker      # Run REPL with your app context

Laravel App & Environment

php artisan about           # Display info about the application
php artisan env             # Show current environment
php artisan down            # Put the app into maintenance mode
php artisan up              # Bring the app out of maintenance mode
php artisan key:generate    # Generate a new app key
php artisan config:cache    # Cache config
php artisan config:clear    # Clear config cache
php artisan cache:clear     # Clear application cache
php artisan route:cache     # Cache routes
php artisan route:clear     # Clear route cache
php artisan view:cache      # Cache Blade views
php artisan view:clear      # Clear compiled views
php artisan optimize        # Cache routes, config, events, and views
php artisan optimize:clear  # Clear all caches

Laravel Make / Generate Commands

php artisan make:command     NameCommand     # Custom Artisan command
php artisan make:controller  NameController  # Controller
php artisan make:model       NameModel       # Model
php artisan make:migration   create_table    # Migration
php artisan make:seeder      NameSeeder      # Seeder
php artisan make:factory     NameFactory     # Model factory
php artisan make:policy      NamePolicy      # Policy
php artisan make:observer    NameObserver    # Model observer
php artisan make:provider    NameProvider    # Service provider
php artisan make:middleware  NameMiddleware  # Middleware
php artisan make:request     NameRequest     # Form request
php artisan make:job         NameJob         # Job
php artisan make:event       NameEvent       # Event
php artisan make:listener    NameListener    # Listener
php artisan make:mail        NameMail        # Mailable
php artisan make:notification NameNotification # Notification
php artisan make:resource    NameResource    # API resource
php artisan make:test        NameTest        # PHPUnit test
php artisan make:rule        NameRule        # Validation rule
php artisan make:component   NameComponent   # Blade component
php artisan make:channel     NameChannel     # Broadcast channel
php artisan make:enum        NameEnum        # PHP 8.1 Enum (Laravel 9+)
php artisan make:cast        NameCast        # Custom Eloquent cast

Database Commands For Laravel

php artisan migrate             # Run all migrations
php artisan migrate:rollback    # Rollback last batch
php artisan migrate:reset       # Rollback all migrations
php artisan migrate:refresh     # Rollback & re-run all migrations
php artisan migrate:fresh       # Drop all tables & re-run migrations
php artisan migrate:status      # Migration status
php artisan db:seed             # Run seeders
php artisan db:wipe             # Drop all tables, views, and types
php artisan schema:dump         # Dump DB schema

Queue / Jobs For Laravel

php artisan queue:table       # Create a migration for jobs table
php artisan queue:work        # Process jobs from the queue
php artisan queue:listen      # Listen to the queue
php artisan queue:retry       # Retry failed jobs
php artisan queue:failed      # List failed jobs
php artisan queue:flush       # Flush failed jobs
php artisan queue:forget      # Delete a failed job
php artisan queue:prune-batches # Delete old batch records

Events & Broadcasting For Laravel

php artisan event:generate   # Generate missing events & listeners
php artisan event:cache      # Cache event and listener mappings
php artisan event:clear      # Clear cached events

Laravel Routes

php artisan route:list       # List all routes
php artisan route:cache      # Cache routes
php artisan route:clear      # Clear route cache

Laravel Storage / Files and Testing

php artisan storage:link     # Create a symbolic link to storage
php artisan test             # Run tests (PHPUnit/Pest)
php artisan test --filter X  # Run specific test

Laravel Other Utilities

php artisan schedule:run       # Run scheduled tasks
php artisan serve              # Run local dev server
php artisan vendor:publish     # Publish package assets
php artisan package:discover   # Discover installed packages
php artisan lang:publish       # Publish language files (Laravel 10+)

Conclusion

Mastering Laravel Artisan commands can significantly improve your development speed and efficiency. Instead of manually handling repetitive tasks, Artisan provides ready-to-use commands that automate much of the workflow. By regularly using and exploring these commands, developers can save time, maintain cleaner code, and focus on building powerful applications. Keep this list handy as your go-to cheat sheet for everyday Laravel development.

Comments are closed