Q:

laravel - how to check auth guard in javascript?

in balde and controller when i want to get the authenticated admin i use
$data=Auth::guard('admin')->user(); 
is there a way to get this in a javascript variable and then console.log it?
i have tried to solve this by this but it doesn't work. I have also searched google and stackoverflow but cannot get an existing answer
var data = <?php Auth::guard('admin')->user();?>
console.log(data);

i'm using hesto multiauth

A:

i solved the problem by doing this.
var data =  <?= Auth::guard('customer')->user() ?>;

