Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel how to use @auth and @guest with multi authentication

@if (Auth::guard('admin')->check())
  @include('admin.auth-links')
@elseif(Auth::guard('supervisor')->check())
  @include('supervisor.auth-links')
@elseif(Auth::guard('instructor')->check())
  @include('instructor.auth-links')
@else
  @include('auth-links')
@endif

// Logout link can be single endpoint which logouts multiple guards.
 
PREVIOUS NEXT
Tagged: #Laravel #multi #authentication
ADD COMMENT
Topic
Name
4+2 =