if (\Auth::guest()) {
$links = '1';
} else {
$links = '2';
}
\Debugbar::info(\Auth::guest());
view()->composer('menu.menu', function($view) use ($links) {
$view->with('links', $links);
});
dd($auth->user()); // null
view()->composer('partials.nav', function($view) use ($auth){
dd($auth->user()); // returns User object
$view->with('currentUser', $auth->user()); // does what you expect
});