devnotes.

The Artisan Command Line

Artisan is Laravel's built-in command-line interface, and it is one of the framework's biggest productivity boosters. Run php artisan list to see every available command.

Common commands:

php artisan serve                  # Start the local dev server
php artisan make:controller PostController
php artisan make:model Post -mfs   # Model + migration + factory + seeder
php artisan make:migration create_posts_table
php artisan migrate                # Run pending migrations
php artisan migrate:rollback       # Undo the last migration batch
php artisan route:list             # List all registered routes
php artisan tinker                 # Interactive PHP REPL for your app
php artisan make:middleware EnsureUserIsSubscribed
php artisan queue:work             # Process queued jobs
php artisan test                   # Run the test suite

You can also write your own Artisan commands with php artisan make:command SendWeeklyReport, which scaffolds a class in app/Console/Commands with a handle() method — perfect for scheduled tasks, data imports, or one-off maintenance scripts. Custom commands are automatically registered and can be scheduled in routes/console.php using the fluent scheduler: Schedule::command('report:send')->weekly();

Laravel Artisan CLI: Essential Commands | DevNotes