0

I know I can set sanctum token expiration time in config/sanctum.php but this expiration seems to be global. How can I set a different expiration time base on their role. e.g super admin token should expire after 30 minutes while admin should expire after 15 minute.

emmy felico
  • 31
  • 1
  • 2
  • 9

1 Answers1

0

While authenticating a user, You can dynamically set 'expiration' key of sanctum configuration based on your user type.

config(['sanctum.expiration' => 525600]);