29 Mar 2022

laravel Cheat Sheet | PHP artisan commands in Laravel

 Artisan

clear-compiledRemove the compiled class file
downPut the application into maintenance mode
envDisplay the current framework environment
helpDisplays help for a command
inspireDisplay an inspiring quote
listLists commands
migrateRun the database migrations
optimizeOptimize the framework for better performance (deprecated)
presetSwap the front-end scaffolding for the application
serveServe the application on the PHP development server
tinkerInteract with your application
upBring the application out of maintenance mode

APP

app:name             Set the application namespace

KEY

key:generate         Set the application key

MAKE

make:authScaffold basic login and registration views and routes
make:commandCreate a new Artisan command
make:controllerCreate a new controller class
make:eventCreate a new event class
make:exceptionCreate a new custom exception class
make:factoryCreate a new model factory
make:jobCreate a new job class
make:listenerCreate a new event listener class
make:mailCreate a new email class
make:middlewareCreate a new middleware class
make:migrationCreate a new migration file
make:modelCreate a new Eloquent model class
make:notificationCreate a new notification class
make:policyCreate a new policy class
make:providerCreate a new service provider class
make:requestCreate a new form request class
make:resourceCreate a new resource
make:ruleCreate a new validation rule
make:seederCreate a new seeder class
make:testCreate a new test class

MIGRATION

  migrate:fresh        Drop all tables and re-run all migrations
  migrate:install      Create the migration repository
  migrate:refresh      Reset and re-run all migrations
  migrate:reset        Rollback all database migrations
  migrate:rollback     Rollback the last database migration
  migrate:status       Show the status of each migration

ROUTE

  route:cache          Create a route cache file for faster route registration
  route:clear          Remove the route cache file
  route:list           List all registered routes

schedule

  schedule:run         Run the scheduled commands

SESSION

  session:table        Create a migration for the session database table

STORAGE

  storage:link         Create a symbolic link from "public/storage" to "storage/app/public"

VENDOR

  vendor:publish       Publish any publishable assets from vendor packages

VIEW

  view:clear           Clear all compiled view files

No comments:

Post a Comment