I have below
<!-- Sidebar Area --> @if (\Request::is('*/fields*')) @include('streams.nav.editor-menu') @else @include('streams.nav.menu') @endif <!-- Content area --> @yield('content')
As you can see, up until now I have used below condition, to check whether a specific sidebar should be shown:
Above simply checks if the route contains the
fields routes, as defined below:
Now, I've reached a point where I need to use this sidebar on another route resource:
I could just add this to my
@if (\Request::is('*/fields*') or \Request::is('*/documents*')) ... @endif
However, I suppose down the road that I would need to add even more routes to this statement.
What would be the best approach to this? Would it be possible to maybe declare this in the
controller or maybe even the
model? Something like:
//Fields.php /** * Specifies whether the editor menu should be shown or not. * * @return bool */ $sidebarEditor = true;
However, I am a bit unsure about how to implement this - or if there is a better approach?