for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BiiiiiigMonster\LaravelEnum\Commands;
use Illuminate\Console\GeneratorCommand;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputOption;
#[AsCommand(name: 'make:enumMeta')]
class EnumMetaMakeCommand extends GeneratorCommand
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'make:enumMeta';
* The console command description.
protected $description = 'Create a new custom enum meta attribute.';
* The type of class being generated.
protected $type = 'EnumMeta';
* Get the stub file for the generator.
* @return string
protected function getStub()
$relativePath = '/stubs/enum_meta.stub';
return file_exists($customPath = $this->laravel->basePath(trim($relativePath, '/')))
? $customPath
: __DIR__.$relativePath;
}
* Get the default namespace for the class.
* @param string $rootNamespace
protected function getDefaultNamespace($rootNamespace)
return $rootNamespace.'\Enums\Metas';
* Get the console command arguments.
* @return array
protected function getOptions()
return [
['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the enum meta already exists'],
];