for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\QueueableAction\Commands;
use Illuminate\Console\GeneratorCommand;
use Symfony\Component\Console\Input\InputOption;
class ActionMakeCommand extends GeneratorCommand
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'make:action';
* The console command description.
protected $description = 'Create a new action class';
* The type of class being generated.
protected $type = 'Action';
* Get the stub file for the generator.
* @return string
protected function getStub()
$stub = 'action.stub';
return __DIR__ . '/'. $stub;
}
* Get the default namespace for the class.
* @param string $rootNamespace
protected function getDefaultNamespace($rootNamespace)
return $rootNamespace . '\Actions';
* Build the class with the given name.
* Remove the base controller import if we are already in base namespace.
* @param string $name
protected function buildClass($name)
$replace = [];
return str_replace(
array_keys($replace), array_values($replace), parent::buildClass($name)
);
* Get the console command options.
* @return array
protected function getOptions()
return [];