Skip to content

Commit

Permalink
fix(task 8): the right way to pass global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
azampanda committed Nov 6, 2023
1 parent 3083fb9 commit 47102aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public function register()
*/
public function boot()
{
//
View::share('metaTitle', 'Blade Test');
}
}
2 changes: 1 addition & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="csrf-token" content="{{ csrf_token() }}">

{{-- Task: edit one file to pass $metaTitle as "Blade Test" to all views --}}
<title>{{ $metaTitle ?? 'Blade Test' }}</title>
<title>{{ $metaTitle ?? 'Laravel' }}</title>

<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap">
Expand Down

0 comments on commit 47102aa

Please sign in to comment.