I want to display current user loggedin information but without relation. something I just need specific information about the user model.
I have tried this similar question Disabled eager relations
I try above answer and end up with empty user
window.Goyong =
<?php echo json_encode([
'csrfToken' => csrf_token(),
'user' => $currUser->setEagerLoads([])
]); ?>
The result:
{
"csrfToken": "kDc5WmebrWlHzyV77pdYZCW69kaiGK6ZC29zAvFn",
"user": {}
}
How can I show current user without bringing any relation?