Viewing file: SeederMakeCommand.php (1.36 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace Webkul\PackageGenerator\Console\Command;
use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand(name: 'package:make-seeder')] class SeederMakeCommand extends MakeCommand { /** * The name and signature of the console command. * * @var string */ protected $signature = 'package:make-seeder {name} {package} {--force}';
/** * The type of class being generated. * * @var string */ protected $type = 'Seeder';
/** * The console command description. * * @var string */ protected $description = 'Create a new seeder.';
/** * Get the stub file for the generator. */ protected function getStubContents(): string { return $this->packageGenerator->getStubContents('seeder', $this->getStubVariables()); }
/** * Get the stub variables. */ protected function getStubVariables(): array { return [ 'NAMESPACE' => $this->getClassNamespace($this->argument('package').'/Database/Seeders'), 'CLASS' => $this->getClassName(), ]; }
/** * Get the source file path. */ protected function getSourceFilePath(): string { $path = base_path('packages/'.$this->argument('package')).'/src/Database/Seeders';
return "$path/{$this->getClassName()}.php"; } }
|