Useful Laravel Artisan Commands for Developers

Essential Laravel Artisan commands for development, optimization, migrations, and debugging.

Important Commands

  1. Serve Application
    php artisan serve
  2. Create Controller
    php artisan make:controller UserController
  3. Create Model with Migration
    php artisan make:model Product -m
  4. Run Migrations
    php artisan migrate
  5. Rollback Migration
    php artisan migrate:rollback
  6. Clear Cache
    
    php artisan cache:clear
    php artisan config:clear
    php artisan route:clear
    php artisan view:clear
            
  7. Optimize Application
    php artisan optimize
  8. Generate Application Key
    php artisan key:generate
  9. List All Routes
    php artisan route:list
  10. Run Seeder
    php artisan db:seed
  11. Run Queue Worker
    php artisan queue:work
  12. Storage Link
    php artisan storage:link
  13. Create Middleware
    php artisan make:middleware CheckUser
  14. Create Request Validation
    php artisan make:request StoreUserRequest
  15. Create Job
    php artisan make:job SendEmailJob

Important Notes

  • Use php artisan serve only for development.
  • Always clear cache after configuration changes.
  • Use queues for heavy background jobs.
  • Follow MVC structure properly for scalable applications.