Step 1: discover commands in the installed Laravel version
Run Artisan from the application root. Available commands and options can vary by Laravel version and installed packages, so list and help are the most reliable starting points.
Show application information
Summarizes the application environment, Laravel and PHP versions, cache state, drivers, and installed packages.
php artisan about
List available commands
Displays every Artisan command registered by Laravel, the application, and installed packages.
php artisan list
Read command-specific help
Shows the selected command’s arguments, options, and description without executing it.
php artisan help migrate
Run Artisan through Laravel Sail
Runs Artisan inside the Sail application container instead of using the host PHP runtime.
./vendor/bin/sail artisan list
Step 2: generate common application classes
Generators create framework-aware boilerplate in conventional locations. Review every generated file, add authorization and validation deliberately, and commit only the classes the feature needs.
Create a model and migration
Creates an Eloquent model and a matching migration file.
php artisan make:model Invoice --migration
Create a resource controller
Creates a resource-style controller with methods type-oriented around the named model.
php artisan make:controller InvoiceController --resource --model=Invoice
Create a form request
Creates a dedicated request class for authorization and validation rules.
php artisan make:request StoreInvoiceRequest
Create a feature test
Creates a feature test in the project’s test suite.
php artisan make:test InvoiceManagementTest
Create an Artisan command
Creates a custom console command class under the application console-command directory.
php artisan make:command ReconcileInvoices
Step 3: inspect routes, configuration, storage, and runtime data
Prefer read-only inspection before clearing caches or modifying data. Never copy secrets printed from configuration or interactive sessions into tickets, logs, or shared notes.
List application routes
Displays application routes while hiding routes registered by third-party packages.
php artisan route:list --except-vendor
Filter routes by path
Limits route output to URIs matching the provided path text.
php artisan route:list --path=api
Inspect one configuration file
Displays resolved values for the selected configuration file.
php artisan config:show database
Open the application REPL
Starts an interactive shell with the Laravel application booted.
php artisan tinker
Create the public storage link
Creates the configured symbolic link from public storage to application-managed files.
php artisan storage:link
Step 4: review and run database migrations
Back up production data and review migration SQL before deployment. A rollback is only safe when each migration’s down method accurately reverses its change.
Check migration status
Shows which migration files have run and which remain pending.
php artisan migrate:status
Preview migration SQL
Prints the SQL that pending migrations would execute without applying it.
php artisan migrate --pretend
Run pending migrations
Executes all pending migrations against the configured database.
php artisan migrate
Preview and roll back one migration step
The first command previews rollback SQL; the second rolls back the most recent migration step.
php artisan migrate:rollback --step=1 --pretend
php artisan migrate:rollback --step=1
Rebuild a disposable local database
Drops every table, reruns all migrations, and executes database seeders.
php artisan migrate:fresh --seed
Step 5: manage deployment caches
Optimization commands belong in a controlled deployment workflow. Configuration caching changes how environment values are resolved, so env calls should remain inside configuration files.
Build production optimization caches
Caches framework bootstrap information such as configuration, events, routes, and views for production.
php artisan optimize
Clear optimization caches
Removes files generated by optimization and clears keys from the default cache store.
php artisan optimize:clear
Cache configuration only
Combines application configuration into one cached file for faster production loading.
php artisan config:cache
Cache routes and views separately
Caches route registration and precompiles Blade templates.
php artisan route:cache
php artisan view:cache
Step 6: generate and run tests
Run the narrowest useful test while developing, then run the complete suite before merging. Laravel forwards supported Pest or PHPUnit options through the Artisan test runner.
Run the complete test suite
Runs the configured Pest or PHPUnit suite with Laravel’s console reporting.
php artisan test
Run the feature suite
Runs one named test suite and stops after its first failure.
php artisan test --testsuite=Feature --stop-on-failure
Filter to one test
Runs tests whose class or method names match the provided filter.
php artisan test --filter=InvoiceManagementTest
Find slow tests
Runs tests and reports the slowest cases for investigation.
php artisan test --profile
Step 7: operate queues and scheduled tasks
Production workers need a process monitor, and deployments must restart long-running workers so they load new code. Coordinate worker timeouts with the queue connection’s retry_after setting.
Run a development queue worker
Starts a long-running worker with explicit attempt and timeout limits.
php artisan queue:work --tries=3 --timeout=60
Restart workers gracefully
Signals workers to exit after their current job so a process monitor can start fresh processes.
php artisan queue:restart
Inspect scheduled tasks
Lists scheduled tasks and their next expected run times.
php artisan schedule:list
Run the scheduler locally
Runs the scheduler in the foreground and evaluates due tasks each minute.
php artisan schedule:work