I want to get my authenticated $userId as a value in an html element from the moment the function is executed (from the moment the user logs in) and place it in an input element in index.html
my AuthorizedAccessTokenController.php
class AuthorizedAccessTokenController
{
public function getUser(Request $request)
{
//this is the key I want to place in my input
$userId = $request->user()->getKey();
return $userId;
}
}
this is the input in my index.html
<input type="text" value="the $userId">