Support the ongoing development of Laravel.io →
posted 9 years ago
Blade
Last updated 1 year ago.
0

So that is fine if they are logged in, but you haven't defined the other section if they are a guest. So you are getting the blank page for guests, and seeing the content when logged in ?

Last updated 1 year ago.
0

When they are guest, they do see whatever 'content' is yielded. However, I want to provision a system for yielding in content @yield('logged_in') whenever someone in their partial uses @section('logged_in'). As you see, I am doing that, but it doesn't load up. The best it does is load up the default layout with no content yielded, not logged_in content, nor the usual guest content.

It works however if I include('view.name') instead of yield, but that isn't scalable.

Last updated 1 year ago.
0

You could just use 2 different templates that extend the master layout ... and you do that auth check in the controller and then based on that decide which one to render.

Last updated 1 year ago.
0

Thanks for the insight, but how would I do that?

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

aligajani aligajani Joined 29 May 2014

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.