The Laravel Artisan Cheatsheet now has an API. Learn more.

make:middleware

Create a new middleware class

Options

  • test - Generate an accompanying PHPUnit test for the Middleware Optional
  • pest - Generate an accompanying Pest test for the Middleware Optional

Arguments

  • name - The name of the class Required
php artisan make:middleware [--test] [--pest] [--] <name>