share var in a maser layout laravel
View::share('name', Auth::user()->firstname);
share var in a maser layout laravel
View::share('name', Auth::user()->firstname);
share var in a maser layout laravel
require app_path().'/composers.php';
You can even create a file for this purpose, something like app/composers.php and load it in your app/start/global.php:
share var in a maser layout laravel
View::composer('layouts.main', function($view)
{
$view->with('name', Auth::check() ? Auth::user()->firstname : '');
});
share var in a maser layout laravel
View::composer('*', function($view)
{
$view->with('name', Auth::check() ? Auth::user()->firstname : '');
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us