5 months ago

Laravel blade `@auth` condition not working as expected

Posted 5 months ago by amitshahc

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)



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.


Please sign in or create an account to participate in this conversation.