Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Laravel Essentials: 50 Most Used Artisan Commands and Their Functions

Here’s a table with 50 commonly used Laravel Artisan commands, properly sequenced and categorized for clarity:

CategoryCommandDescription
Generalphp artisan listDisplays a list of all available Artisan commands.
php artisan serveServes the application on the PHP built-in web server.
php artisan tinkerOpens an interactive REPL to interact with the application.
php artisan envDisplays the current environment the application is running in.
php artisan key:generateSets the APP_KEY in the .env file.
php artisan optimizeOptimizes the framework for better performance.
Controllersphp artisan make:controllerCreates a new controller.
Modelsphp artisan make:modelCreates a new Eloquent model class.
Migrationsphp artisan make:migrationCreates a new database migration.
php artisan migrateRuns the pending migrations.
php artisan migrate:rollbackRolls back the last database migration.
php artisan migrate:freshDrops all tables and re-runs all migrations.
php artisan migrate:statusDisplays the status of each migration.
Routingphp artisan route:listLists all registered routes.
php artisan route:cacheCaches the application’s routes.
php artisan route:clearClears the route cache.
Middlewarephp artisan make:middlewareCreates a new middleware class.
Form Requestsphp artisan make:requestCreates a new form request class.
Databasephp artisan make:seederCreates a new database seeder class.
php artisan db:seedRuns the database seeders.
php artisan make:factoryCreates a new model factory.
Cache Managementphp artisan cache:clearClears the application cache.
php artisan config:cacheCaches the application configuration.
php artisan config:clearClears the configuration cache.
php artisan view:clearClears compiled view files.
php artisan optimize:clearClears all compiled files and caches.
Jobs & Queuesphp artisan make:jobCreates a new job class.
php artisan queue:workStarts processing jobs on the queue.
php artisan queue:restartRestarts the queue worker after the current job finishes.
php artisan queue:tableCreates a migration for the jobs database table.
Events & Listenersphp artisan make:eventCreates a new event class.
php artisan make:listenerCreates a new event listener class.
php artisan event:generateGenerates event and listener classes for registered events.
Policies & Authorizationphp artisan make:policyCreates a new authorization policy.
Notificationsphp artisan make:notificationCreates a new notification class.
API Resourcesphp artisan make:resourceCreates a new API resource class.
Observersphp artisan make:observerCreates a new observer class for models.
Console & Commandsphp artisan make:commandCreates a new Artisan command.
php artisan make:consoleCreates a new console command.
Testingphp artisan make:testCreates a new test class.
php artisan testRuns the application’s tests.
Providersphp artisan make:providerCreates a new service provider class.
Validationphp artisan make:ruleCreates a new custom validation rule.
Storagephp artisan storage:linkCreates a symbolic link from public/storage to storage/app/public.
Maintenance Modephp artisan downPuts the application into maintenance mode.
php artisan upBrings the application out of maintenance mode.
Vendor Managementphp artisan vendor:publishPublishes vendor package assets, configuration files, or views.
Password Resetsphp artisan auth:clear-resetsFlushes expired password reset tokens.

This table organizes the commands based on their function within the Laravel ecosystem.

Related Posts

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Artificial Intelligence