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

make:command

Create a new Artisan command

Options

  • force - Create the class even if the console command already exists Optional
  • command - The terminal command that should be assigned Optional
  • test - Generate an accompanying PHPUnit test for the Console command Optional
  • pest - Generate an accompanying Pest test for the Console command Optional

Arguments

  • name - The name of the command Required
php artisan make:command [-f|--force] [--command [COMMAND]] [--test] [--pest] [--] <name>