@@ -28,10 +28,13 @@ class PageLinksComposer extends Composer
|
||||
public function compose(View $view)
|
||||
{
|
||||
try {
|
||||
$w = [
|
||||
'enabled' => true,
|
||||
];
|
||||
|
||||
// If not logged in, then only get the public pages
|
||||
$w = ['enabled' => true];
|
||||
if (!Auth::check()) {
|
||||
$w = ['public' => true];
|
||||
$w['public'] = true;
|
||||
}
|
||||
|
||||
$pages = $this->pageRepo->findWhere($w, ['id', 'name', 'slug', 'icon']);
|
||||
|
||||
@@ -34,6 +34,15 @@
|
||||
</li>
|
||||
@endforeach
|
||||
|
||||
@foreach($page_links as $page)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url(route('frontend.pages.show', ['slug' => $page->slug])) }}">
|
||||
<i class="{{ $page['icon'] }}"></i>
|
||||
<p>{{ $page['name'] }}</p>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
|
||||
@if(!Auth::check())
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url('/register') }}">
|
||||
@@ -77,15 +86,6 @@
|
||||
</li>
|
||||
@endforeach
|
||||
|
||||
@foreach($page_links as $page)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url(route('frontend.pages.show', ['slug' => $page->slug])) }}">
|
||||
<i class="{{ $page['icon'] }}"></i>
|
||||
<p>{{ $page['name'] }}</p>
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
|
||||
<li class="nav-item dropdown ">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button"
|
||||
data-toggle="dropdown" data-boundary="viewport" aria-haspopup="true" aria-expanded="false">
|
||||
|
||||
Reference in New Issue
Block a user