From ab8092ee976450f36d6a42d56d062af6a936732d Mon Sep 17 00:00:00 2001 From: philipp lang Date: Fri, 25 Oct 2024 00:51:07 +0200 Subject: [PATCH] Add page title --- app/View/Page/Layout.php | 1 + resources/views/components/layouts/app.blade.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/View/Page/Layout.php b/app/View/Page/Layout.php index d136065d..8619ee34 100644 --- a/app/View/Page/Layout.php +++ b/app/View/Page/Layout.php @@ -9,6 +9,7 @@ class Layout extends Component public function __construct(public string $pageClass = '', public string $title = '') { + session()->put('title', $title); } public function userName(): string diff --git a/resources/views/components/layouts/app.blade.php b/resources/views/components/layouts/app.blade.php index c94be427..52f704a4 100644 --- a/resources/views/components/layouts/app.blade.php +++ b/resources/views/components/layouts/app.blade.php @@ -4,7 +4,7 @@ - {{ $title ?? 'Page Title' }} + {{ session()->get('title') }} | {{ config('app.name') }} @if(auth()->id())