I am Using Laravel 5.4 Passport Authentication. I have a problem to set API token expire date for 30 days. I have tried given code in Laravel documentation but it's not working. In the database, it's showing one year default token expiration date.
I have used
public function boot(){
$this->registerPolicies();
Passport::routes();
Passport::tokensExpireIn(Carbon::now()->addDays(30));
}
if there is any solution please suggest me.
Thanks
i also got same issue so.. i used like that
try to change directly in PassportServiceProvider.php
go to PassportServiceProvider.php
path should be like this
projectName/vendor/laravel/passport/src/PassportServiceProvider.php
and fine this line
new PersonalAccessGrant, new DateInterval('P1Y')
for example set expiry 1 month then
new PersonalAccessGrant, new DateInterval('P1M')
for example set expiry 1 week then
new PersonalAccessGrant, new DateInterval('P1W')
for example set expiry 5 DAYS then
new PersonalAccessGrant, new DateInterval('P5D')
for more DateInterval see
github issue see
stackoverflow question see