I have a multi-auth system setup (using a custom version of the Hesto package) within Laravel 5.5, and everything is working just as I like except for this one detail. On the "welcome.php" landing page, the navbar should show different links respective of login status, and authorized user-type.
case 1: -User is not logged in, and should see two auth links: 1) User login 2) Client login case 2: -User is logged in as a "user", and should only see a link for their dashboard ('/user/dashboard') case 3: -User is logged in as a "client", and should only see a link for their respective dashboard ('/client/dashboard')
I thought my syntax below would be correct, but I'm having an issue after the @else statement. Case 1 shows no links at all, and no error response.
@if (Route::has('login'))
// Check 'user' guard
@auth('user')
<a class="nav-item nav-link theme-faded-bg-light" href="{{ url('/user/dashboard') }}">Dashboard</a>
@endauth
// Check 'client' guard
@auth('client')
<a class="nav-item nav-link theme-faded-bg-light" href="{{ url('/client/dashboard') }}">Dashboard</a>
@endauth
@else
<a class="nav-item nav-link theme-faded-bg-light" href="{{ route('user-login') }}">Firm Login</a>
<a class="nav-item nav-link theme-faded-bg-light" href="{{ route('client-login') }}">Client Login</a>
@endif
I've tried several reorganized/reformulated version of the above code to no avail. Most throw syntax errors. I can give examples if necessary. I know I'm missing something very simple but have bashed my head against the wall too many times now to have any hope of finding it on my own.
Thanks so much in advance. Let me know if you need any other bits of my code.
config/auth.php
'defaults' => [ 'guard' => 'web', 'passwords' => 'users', ], // Guards 'guards' => [ 'client' => [ 'driver' => 'session', 'provider' => 'clients', ], 'user' => [ 'driver' => 'session', 'provider' => 'users', ], 'admin' => [ 'driver' => 'session', 'provider' => 'admins', ], 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'token', 'provider' => 'users', ], ], // Providers 'providers' => [ 'clients' => [ 'driver' => 'eloquent', 'model' => App\Client::class, ], 'admins' => [ 'driver' => 'eloquent', 'model' => App\Admin::class, ], 'users' => [ 'driver' => 'eloquent', 'model' => App\User::class, ], ],