Fix public pages not showing properly #708 (#749)

This commit is contained in:
Nabeel S
2020-06-05 09:49:22 -07:00
committed by GitHub
parent c6482bd160
commit 340f52112d
2 changed files with 14 additions and 11 deletions

View File

@@ -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']);

View File

@@ -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">