Useful Laravel Artisan Commands for Developers
Essential Laravel Artisan commands for development, optimization, migrations, and debugging.
Important Commands
-
Serve Application
php artisan serve -
Create Controller
php artisan make:controller UserController -
Create Model with Migration
php artisan make:model Product -m -
Run Migrations
php artisan migrate -
Rollback Migration
php artisan migrate:rollback -
Clear Cache
php artisan cache:clear php artisan config:clear php artisan route:clear php artisan view:clear -
Optimize Application
php artisan optimize -
Generate Application Key
php artisan key:generate -
List All Routes
php artisan route:list -
Run Seeder
php artisan db:seed -
Run Queue Worker
php artisan queue:work -
Storage Link
php artisan storage:link -
Create Middleware
php artisan make:middleware CheckUser -
Create Request Validation
php artisan make:request StoreUserRequest -
Create Job
php artisan make:job SendEmailJob
Important Notes
- Use
php artisan serveonly for development. - Always clear cache after configuration changes.
- Use queues for heavy background jobs.
- Follow MVC structure properly for scalable applications.