Support the ongoing development of Laravel.io →
Requests Views Validation
Last updated 3 months ago.
0

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 }}
Last updated 3 months ago.
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.