Laravel commands list

Routes

  1. List of all routes that are defined by application
    php artisan route:list
  2. List of all routes with middleware
    php artisan route:list -v
  3. Hide third party routes
    php artisan route:list --except-vendor
  4. Cache route
    php artisan route:cache
  5. Clear all the cached routes
    php artisan route:clear

Middlewares

  1. To create a new middleware
    php artisan make:middleware isAdmin

Controllers

  1. To create single action controller
    php artisan make:controller PaymentVerification --invokable
  2. To create new resource controller
    php artisan make:controller Blog --resource
  3. To generate api resource controller that does not include create and edit methods
    php artisan make:controller AudioController --api

Views

  1. To cache views
    php artisan view:cache
  2. To clear cache views
    php artisan view:clear

Blade

  1. To create new component
    php artisan make:component likes

Session

  1. To create session table
    php artisan session:table

Requests

  1. To create custom request class
    php artisan make:request StoreFormRequest

Errors

  1. To publish default laravel pages
    php artisan vendor:public --tag=laravel-errors

 

© 2016 - 2022, All Rights are Reserved.