Add $user (authed user) to views

This commit is contained in:
Deon George
2021-09-28 00:21:21 +10:00
parent ca666e456a
commit 2c406ba3e9
7 changed files with 59 additions and 8 deletions

View File

@@ -27,7 +27,7 @@
<dl>
<dt>Expore Networks</dt>
@foreach (\App\Models\Domain::active()
->when(! \Illuminate\Support\Facades\Auth::check(),function($query) { return $query->public(); })
->when((! $user),function($query) { return $query->public(); })
->orderBy('name')->get() as $o)
<dd><a href="{{ url('network',['id'=>$o->id]) }}" title="{{ $o->description }}">{{ $o->name }}</a></dd>
@endforeach