/home/techb158/immovalet.com/platform/packages/dev-tool/src/Commands
Edit: /home/techb158/immovalet.com/platform/packages/dev-tool/src/Commands/PackageCreateCommand.php (2703B)
argument('name'))) {
$this->error('Only alphabetic characters are allowed.');
return 1;
}
$package = strtolower($this->argument('name'));
$location = package_path($package);
if (File::isDirectory($location)) {
$this->error('A package named [' . $package . '] already exists.');
return 1;
}
$this->publishStubs($this->getStub(), $location);
$this->renameFiles($package, $location);
$this->searchAndReplaceInFiles($package, $location);
$this->line('------------------');
$this->line('
The package ' . $package . ' was created in ' . $location . ', customize it!');
$this->line('
Add "botble/' . $package . '": "*@dev" to composer.json then run
composer update to install this package!');
$this->line('------------------');
$this->call('cache:clear');
return 0;
}
/**
* {@inheritDoc}
*/
public function getStub(): string
{
return __DIR__ . '/../../stubs/module';
}
/**
* {@inheritDoc}
*/
public function getReplacements(string $replaceText): array
{
return [
'{-module}' => strtolower($replaceText),
'{module}' => Str::snake(str_replace('-', '_', $replaceText)),
'{+module}' => Str::camel($replaceText),
'{modules}' => Str::plural(Str::snake(str_replace('-', '_', $replaceText))),
'{Modules}' => ucfirst(Str::plural(Str::snake(str_replace('-', '_', $replaceText)))),
'{-modules}' => Str::plural($replaceText),
'{MODULE}' => strtoupper(Str::snake(str_replace('-', '_', $replaceText))),
'{Module}' => ucfirst(Str::camel($replaceText)),
];
}
}