Support the ongoing development of Laravel.io →
Authentication Security Blade
Last updated 1 year ago.
0

I'm actually taking a similar approach for this http://paste.laravel.com/1cWa. The reason I had chosen for this is, because I didn't want to spent hours and hours on such a simple thing... also it works fine for now. FYI.. i've used controller templating in this project.

Last updated 1 year ago.
0

So you include the top bar if the user is logged in, do you @else to display a different one for guests?

I thought about creating two different menus, each with their own nav elements - but many will be common between the two so it seemed a little repetitive to build the menu twice.

Last updated 1 year ago.
0

You could simply have one header, but use Auth::check() and @include to include a partial when the user is logged in.

Last updated 1 year ago.
0

Yeah that makes the most sense - ill put the 'my account' bit in a partial, cheers.

Last updated 1 year ago.
0

Thanks :)

Last updated 1 year ago.
0

This is a really good idea. I had been using two layouts, but will wrap the header in an if statement. Every bit helps I suppose.

Last updated 1 year ago.
0

IMO, if you are controlling access to only a few menu items then you should keep one layout, and there is no need for partials. Simply:

@if (Auth::guest())
// login link
@else
// logout link

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

nodeseo nodeseo Joined 8 Dec 2013

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.