ekart/backend/app/Console/Commands/MakeActionCommand.php
kusowl 30bc4a0cf3 chore: add command to generate actions
use `artisan make:action <name>` to generate final & readonly php class with execute method.
2026-02-26 16:05:03 +05:30

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';
}
}