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.
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.
You could simply have one header, but use Auth::check() and @include to include a partial when the user is logged in.
Yeah that makes the most sense - ill put the 'my account' bit in a partial, cheers.
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.
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:
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community