You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
35 lines
1.0 KiB
<?php
|
|
|
|
namespace {{ namespace }};
|
|
|
|
use Illuminate\Support\Facades\View;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class {{ class }} extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
/**
|
|
* Register a view composer for presentation glue.
|
|
*
|
|
* This binds data to specific layout assets (e.g., sidebar) using
|
|
* a decoupled query pattern, keeping the domain's root provider pristine.
|
|
*/
|
|
View::composer('components.layouts.sidebar', function ($view) {
|
|
// Instantiate the internal domain model query dynamically or via DI container
|
|
// $query = $this->app->make(GetSidebarNavigationItems::class);
|
|
// $view->with('navigationItems', $query->execute());
|
|
|
|
$view->with('navigationItems', [
|
|
[
|
|
'label' => 'Dashboard',
|
|
'route' => '{domain}.dashboard',
|
|
'icon' => 'home',
|
|
],
|
|
]);
|
|
});
|
|
}
|
|
}
|
|
|