PURPOSE
- a middleware package can run just before each actual request is treated, e.g. to check for authentication, permissions
- a middleware package can run just before a response is sent back, e.g. to set HTTP headers
USAGE
>php artisan make:middleware CheckSomething Usage: make:middleware <name> Arguments: name The name of the class Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question --env[=ENV] The environment the command should run under -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
OUTPUT
in folder App/Http/Middleware
App/Http/Middleware/CheckSomething.php
Reference: https://laravel.com/docs/6.x/middleware