Skip to content

Commit

Permalink
Merge pull request #1677 from solomon-ochepa/patch-42
Browse files Browse the repository at this point in the history
Update provider.stub
  • Loading branch information
dcblogdev authored Oct 30, 2023
2 parents f7e539b + 61c62ac commit b042ee8
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions src/Commands/stubs/scaffold/provider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,21 @@ class $CLASS$ extends ServiceProvider

/**
* Register commands in the format of Command::class
*
* @return void
*/
protected function registerCommands()
protected function registerCommands(): void
{
/*$this->commands([

]);*/
// $this->commands([]);
}

/**
* Register command Schedules.
*
* @return void
*/
protected function registerCommandSchedules()
protected function registerCommandSchedules(): void
{
/*$this->app->booted(function () {
$schedule = $this->app->make(Schedule::class);
$schedule->command('inspire')->hourly();
});*/
// $this->app->booted(function () {
// $schedule = $this->app->make(Schedule::class);
// $schedule->command('inspire')->hourly();
// });
}

/**
Expand All @@ -78,12 +72,8 @@ class $CLASS$ extends ServiceProvider
*/
protected function registerConfig(): void
{
$this->publishes([
module_path($this->moduleName, '$PATH_CONFIG$/config.php') => config_path($this->moduleNameLower.'.php'),
], 'config');
$this->mergeConfigFrom(
module_path($this->moduleName, '$PATH_CONFIG$/config.php'), $this->moduleNameLower
);
$this->publishes([module_path($this->moduleName, '$PATH_CONFIG$/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, '$PATH_CONFIG$/config.php'), $this->moduleNameLower);
}

/**
Expand All @@ -92,21 +82,16 @@ class $CLASS$ extends ServiceProvider
public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);

$sourcePath = module_path($this->moduleName, '$PATH_VIEWS$');

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

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

$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.config('modules.paths.generator.component-class.path'));
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
}



/**
* Get the services provided by the provider.
*/
Expand Down

0 comments on commit b042ee8

Please sign in to comment.