Artisan Commands in PHP

From the Laravel cheat sheet · Setup & Artisan · verified Jul 2026

Artisan Commands

Essential Artisan CLI commands

php
# Make commands
php artisan make:controller UserController
php artisan make:model User -m  # With migration
php artisan make:migration create_users_table
php artisan make:seeder UserSeeder
php artisan make:factory UserFactory
php artisan make:middleware AuthMiddleware
php artisan make:request StoreUserRequest

# List routes
php artisan route:list
php artisan route:list --path=api

# Tinker (REPL)
php artisan tinker
>>> User::all();
>>> User::find(1);
💡 Use flags like -mfsc to generate multiple related files at once
⚡ Tinker is great for testing queries and debugging
📌 Always clear caches after deployment
🔥 Use queue:work for production, queue:listen for development

More PHP tasks

Back to the full Laravel cheat sheet