Viewing file: ModuleProviderMakeCommand.php (1.41 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-module-provider')] class ModuleProviderMakeCommand extends MakeCommand { /** * The name and signature of the console command. * * @var string */ protected $signature = 'package:make-module-provider {name} {package} {--force}';
/** * The type of class being generated. * * @var string */ protected $type = 'Module Provider';
/** * The console command description. * * @var string */ protected $description = 'Create a new module service provider.';
/** * Get the stub file for the generator. */ protected function getStubContents(): string { return $this->packageGenerator->getStubContents('scaffold/module-provider', $this->getStubVariables()); }
/** * Get the stub variables. */ protected function getStubVariables(): array { return [ 'NAMESPACE' => $this->getClassNamespace($this->argument('package').'/Providers'), 'CLASS' => $this->getClassName(), ]; }
/** * Get the source file path. */ protected function getSourceFilePath(): string { $path = base_path('packages/'.$this->argument('package')).'/src/Providers';
return "$path/{$this->getClassName()}.php"; } }
|