use `artisan make:action <name>` to generate final & readonly php class with execute method.
33 lines
644 B
PHP
33 lines
644 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\GeneratorCommand;
|
|
|
|
class MakeActionCommand extends GeneratorCommand
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'make:action {name}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Create a new action class';
|
|
|
|
protected function getStub(): string
|
|
{
|
|
return base_path('stubs/action.stub');
|
|
}
|
|
|
|
protected function getDefaultNamespace($rootNamespace): string
|
|
{
|
|
return $rootNamespace.'\Actions';
|
|
}
|
|
}
|