Did you create a separate authentication guard? If you don't this won't work!
Documentation: https://laravel.com/docs/5.8/authentication#adding-custom-guards
I am trying to pick the master blade template dynamically as per the current user roll logged in. (here it should go to the 'shopowner' auth block)
@auth('shopmanager')
@extends('theme::Admins.shopmanager.layout.master')
@endauth
@auth('shopowner')
@extends('theme::Admins.shopowner.layout.master')
@endauth
but this always gives error as it tries to compile the 'shopmanager' master template. It is not going into the 'shopmanager' @auth block because it's not printing anything if I print inside that block.
It only works if I completely comment that line.
P.S.: i tried using this syntax too.. but same results.
if (Auth::guard('shopmanager')->check())
...
also echo the condition check which works perfect without @extends(...) syntax.
This goes in shopowner which is right.
@if(Auth::guard('shopmanager')->user())
{{dd(Auth::guard('shopmanager')->user())}}
@else
{{dd(Auth::guard('shopowner')->user())}}
@endif
Please or to participate in this conversation.