From 47102aa55a2a4ccc366ae518df128fa1b752aba4 Mon Sep 17 00:00:00 2001 From: azampanda Date: Mon, 6 Nov 2023 17:44:32 +0800 Subject: [PATCH] fix(task 8): the right way to pass global variable --- app/Providers/AppServiceProvider.php | 2 +- resources/views/layouts/app.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 38c135bd..22084759 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -24,6 +24,6 @@ public function register() */ public function boot() { - // + View::share('metaTitle', 'Blade Test'); } } diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 282cefd2..9da21478 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -6,7 +6,7 @@ {{-- Task: edit one file to pass $metaTitle as "Blade Test" to all views --}} - {{ $metaTitle ?? 'Blade Test' }} + {{ $metaTitle ?? 'Laravel' }}