I use passport to make authentication for my API's i run this command to install passport :
php artisan passport:install --force
and use the following codes to generate token :
$objToken = $user->createToken('Token');
$strToken = $objToken->accessToken;
$expiration = $objToken->token->expires_at->diffForHumans();
return response()->json([
token' => $strToken,
'ExpireTime' => $expiration,
], 200);
i found that my token lifetime is one year, i just want to make the expire_at column to 1 hour i read official document and add following codes to AuthServiceProvider:
Passport::tokensExpireIn(now()->addDays(15));
Passport::refreshTokensExpireIn(now()->addDays(30));
but those codes not working and when i log the expire_at , this still be one year please help me to change expiration time of my tokens. thakns alot :)