diff --git a/app/View/Page/Layout.php b/app/View/Page/Layout.php index 8619ee34..cda28627 100644 --- a/app/View/Page/Layout.php +++ b/app/View/Page/Layout.php @@ -7,9 +7,10 @@ use Illuminate\View\Component; class Layout extends Component { - public function __construct(public string $pageClass = '', public string $title = '') + public function __construct(public string $pageClass = '', public string $title = '', public string $menu = '') { session()->put('title', $title); + session()->put('menu', $menu); } public function userName(): string diff --git a/app/View/Page/SettingLayout.php b/app/View/Page/SettingLayout.php index 766592dd..442b6e13 100644 --- a/app/View/Page/SettingLayout.php +++ b/app/View/Page/SettingLayout.php @@ -18,13 +18,12 @@ class SettingLayout extends Component 'is_active' => get_class($setting) === $active, 'title' => $setting->title(), ])->toArray(); - session()->put('menu', 'setting'); } public function render() { return <<<'HTML' - + {{ $right ?? '' }} diff --git a/modules/Dashboard/Components/DashboardComponent.php b/modules/Dashboard/Components/DashboardComponent.php index a57f8504..16d1c2fe 100644 --- a/modules/Dashboard/Components/DashboardComponent.php +++ b/modules/Dashboard/Components/DashboardComponent.php @@ -12,16 +12,13 @@ class DashboardComponent extends Component public function mount(DashboardFactory $factory): void { - session()->put('menu', 'dashboard'); - session()->put('title', 'Dashboard'); - $this->blocks = $factory->load(); } public function render(): string { return <<<'HTML' - +
@foreach($this->blocks as $block)