Skip to content

Commit

Permalink
[patch] Change variable case to camelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
solomon-ochepa committed Aug 31, 2024
1 parent 03e2427 commit 7d9bdf5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Commands/stubs/scaffold/provider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class $CLASS$ extends ServiceProvider

protected string $name = '$MODULE$';

protected string $name_lower = '$LOWER_NAME$';
protected string $nameLower = '$LOWER_NAME$';

/**
* Boot the application events.
Expand Down Expand Up @@ -60,13 +60,13 @@ class $CLASS$ extends ServiceProvider
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/'.$this->name_lower);
$langPath = resource_path('lang/modules/'.$this->nameLower);

if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->name_lower);
$this->loadTranslationsFrom($langPath, $this->nameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->name, '$PATH_LANG$'), $this->name_lower);
$this->loadTranslationsFrom(module_path($this->name, '$PATH_LANG$'), $this->nameLower);
$this->loadJsonTranslationsFrom(module_path($this->name, '$PATH_LANG$'));
}
}
Expand All @@ -76,24 +76,24 @@ class $CLASS$ extends ServiceProvider
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->name, '$PATH_CONFIG$/config.php') => config_path($this->name_lower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->name, '$PATH_CONFIG$/config.php'), $this->name_lower);
$this->publishes([module_path($this->name, '$PATH_CONFIG$/config.php') => config_path($this->nameLower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->name, '$PATH_CONFIG$/config.php'), $this->nameLower);
}

/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->name_lower);
$viewPath = resource_path('views/modules/'.$this->nameLower);
$sourcePath = module_path($this->name, '$PATH_VIEWS$');

$this->publishes([$sourcePath => $viewPath], ['views', $this->name_lower.'-module-views']);
$this->publishes([$sourcePath => $viewPath], ['views', $this->nameLower.'-module-views']);

$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->name_lower);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->nameLower);

$componentNamespace = $this->module_namespace($this->name, $this->app_path(config('modules.paths.generator.component-class.path')));
Blade::componentNamespace($componentNamespace, $this->name_lower);
Blade::componentNamespace($componentNamespace, $this->nameLower);
}

/**
Expand All @@ -108,8 +108,8 @@ class $CLASS$ extends ServiceProvider
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path.'/modules/'.$this->name_lower)) {
$paths[] = $path.'/modules/'.$this->name_lower;
if (is_dir($path.'/modules/'.$this->nameLower)) {
$paths[] = $path.'/modules/'.$this->nameLower;
}
}

Expand Down

0 comments on commit 7d9bdf5

Please sign in to comment.