share var in a maser layout laravel

Solutions on MaxInterview for share var in a maser layout laravel by the best coders in the world

showing results for - "share var in a maser layout laravel"
Giuseppe
21 Jun 2019
1View::composer('*', function($view)
2{
3    $view->with('name', Auth::check() ? Auth::user()->firstname : '');
4});
5
Ariana
20 Aug 2017
1View::share('name', Auth::user()->firstname);
2
Mats
06 Nov 2019
1require app_path().'/composers.php';
2You can even create a file for this purpose, something like app/composers.php and load it in your app/start/global.php:
Lalie
16 Mar 2019
1View::composer('layouts.main', function($view)
2{
3    $view->with('name', Auth::check() ? Auth::user()->firstname : '');
4});
5
similar questions
queries leading to this page
share var in a maser layout laravel