While I am familiar with the authentication
verification in laravel
, I am interested in learning how to verify it using jQuery
.
Specifically, I want to make changes to my CSS
when a user is logged in.
By default:
body{
background: url('image.jpg');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
If the user is logged in, I want my CSS
to be updated as follows:
body{
/*Nothing*/
}
I attempted something in my js
file:
var loggedIn={!! json_encode(Auth::check()) !!};
if(loggedIn)
alert('Logged In as user!');
However, the above code did not produce the desired result. I require assistance. If there is an alternative method that can achieve my goal, please advise.
Thank you