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