I generally share $currentUser to my views, with something like this in the base controller or something like that...
View::share('currentUser', Auth::user());
Then, in the view you can do something like..
@if($currentUser)
@include('whatever')
@else
@include('other.thing')
@endif
Additionally, I tend to just output $content rather than use a section. My goal is to get a hard PHP failure if $content isn't assigned.
{{ $content }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community