if (!Auth::guard('api')->attempt(['email' => $email, 'password' => $password])){
return response()->json([
'message' => 'Login failed!'
], 401);
}
$user = Auth::guard('api')->user();
$token = $user->createToken("Token of user: {$user->name}")->plainTextToken;