xxxxxxxxxx
User::first()->createToken($name, $scopes);
xxxxxxxxxx
public function details()
{
$user = Auth::user();
return response()->json(['success' => $user], $this->successStatus);
}
xxxxxxxxxx
// Add this function to User model
/**
* @param $identifier
* @return Model|Builder|null
*/
public function findForPassport($identifier): Model|Builder|null
{
return $this->newQuery()->where('username', $identifier)->first();
}