laravel['modules']->findOrFail($this->getModuleName()); return (new Stub('/seeder.stub', [ 'NAME' => $this->getSeederName(), 'MODULE' => $this->getModuleName(), 'NAMESPACE' => $this->getClassNamespace($module), ]))->render(); } protected function getDestinationFilePath(): mixed { $this->clearCache(); $path = $this->laravel['modules']->getModulePath($this->getModuleName()); $seederPath = GenerateConfigReader::read('seeder'); return $path . $seederPath->getPath() . '/' . $this->getSeederName() . '.php'; } /** * Get the seeder name. */ private function getSeederName(): string { $string = $this->argument('name'); $string .= $this->option('master') ? 'Database' : ''; $suffix = 'Seeder'; if (strpos($string, $suffix) === false) { $string .= $suffix; } return Str::studly($string); } /** * Get default namespace. */ public function getDefaultNamespace(): string { return config('modules.paths.generator.seeder.namespace') ?? ltrim(config('modules.paths.generator.seeder.path', 'Database/Seeders'), config('modules.paths.app_folder', '')); } }