diff --git a/config/livewire.php b/config/livewire.php index 9367d20..4454b99 100644 --- a/config/livewire.php +++ b/config/livewire.php @@ -3,5 +3,5 @@ return [ 'legacy_model_binding' => true, - 'layout' => 'layout::admin' + 'layout' => 'layout::frontend' ]; diff --git a/src/Commands/RapydMakeHomeCommand.php b/src/Commands/RapydMakeHomeCommand.php index e5fe50c..4c1ce08 100644 --- a/src/Commands/RapydMakeHomeCommand.php +++ b/src/Commands/RapydMakeHomeCommand.php @@ -55,6 +55,7 @@ public function handle() 'class' => "\\".$classNamespace."\\Home", 'routepath' => $routeuri, 'routename' => $routename, + 'layout' => 'layout::frontend', ])); $substituted = $strSubstitutor->replace(file_get_contents(__DIR__.'/Templates/routes/home.stub')); diff --git a/src/Commands/Templates/Livewire/Home.stub b/src/Commands/Templates/Livewire/Home.stub index 1a56531..d6a7418 100644 --- a/src/Commands/Templates/Livewire/Home.stub +++ b/src/Commands/Templates/Livewire/Home.stub @@ -8,6 +8,6 @@ class {{class}} extends {{baseClassName}} { public function render() { - return view('{{view}}'); + return view('{{view}}')->layout('{{layout}}'); } } diff --git a/src/Commands/Templates/routes/home.stub b/src/Commands/Templates/routes/home.stub index a32687e..0c39cbe 100644 --- a/src/Commands/Templates/routes/home.stub +++ b/src/Commands/Templates/routes/home.stub @@ -1,6 +1,6 @@ Route::get('{{routepath}}', {{class}}::class) - ->middleware(['web','auth']) + ->middleware(['web']) ->name('{{routename}}') ->crumbs(fn ($crumbs) => $crumbs->push('Home', route('{{routename}}'))); diff --git a/src/Modules/ModuleServiceProvider.php b/src/Modules/ModuleServiceProvider.php index 5ff2c26..56a0aa0 100644 --- a/src/Modules/ModuleServiceProvider.php +++ b/src/Modules/ModuleServiceProvider.php @@ -4,6 +4,7 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Facades\File; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Str; @@ -79,9 +80,9 @@ private function enableModules(): void if (File::exists($moduleConfigPath)) { $this->mergeConfigFrom($moduleConfigPath, $moduleName); //overrire default layout - if (config($moduleName.'.layout')) { - config(['livewire.layout' => config($moduleName.'.layout')]); - } +// if (config($moduleName.'.layout')) { +// config(['livewire.layout' => config($moduleName.'.layout')]); +// } } $this->loadViewsFrom($modulePath . 'Views', $moduleName); $this->loadViewsFrom($modulePath . 'Livewire', $moduleName);//'components'); diff --git a/src/RapydServiceProvider.php b/src/RapydServiceProvider.php index 49cf067..148f493 100644 --- a/src/RapydServiceProvider.php +++ b/src/RapydServiceProvider.php @@ -2,6 +2,8 @@ namespace Zofe\Rapyd; + +use App\Modules\Layout\LayoutServiceProvider; use Illuminate\Foundation\Http\Events\RequestHandled; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Blade; @@ -161,6 +163,7 @@ public function register() $this->app->register(BreadcrumbsServiceProvider::class); $this->app->register(ModuleServiceProvider::class); + $this->app->register(LayoutServiceProvider::class); //$this->app->register(StubGeneratorServiceProvider::class); } }