Support the ongoing development of Laravel.io →
Requests Views Validation
Last updated 1 year 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 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.