I was wondering if the cookie name which hard coded here (laravel_token in "vendor\laravel\passport\src\Passport.php") be made configurable so that we don't have to edit the framework code if we want to rename the cookie? An option like COOKIE_PREFIX coming from .env can be used to optionally build the cookie names.
PS: same comment applies to laravel framework (laravel_session cookie) as well.
I think the following do what you need
Passport::cookie('other_cookie_name');
I think @brunogaspar 's answer was resolved this problem.
@mind-control If you want use .env file (environment variables), you can do:
Passport::cookie(config('auth.passport.cookie', env('PASSPORT_COOKIE', 'laravel_api')));
I noticed this is undocumented. I'll try to update the docs with this.
Most helpful comment
I think the following do what you need