I tried to use Laravel-passport so I installed this package in my project, but when i wanted to make route
i wrote this code in the AuthServiceProvider
public function boot()
{
$this->registerPolicies();
Passport::routes();
}
When i run php artisan route:list in the cmd i face with this error
- Call to undefined method LaravelPassportPassport::routes()
2
Answers
Since version 11 passport’s routes have been moved to a dedicated route file. You can remove the
Passport::routes()
call from your application’s service provider.If you dont want to use default passport routes. you can disabled the route in
register
method inside AppServicerProviderand you can copy the default passport routes from vendor
laravelpassportroutesweb.php
for more detail about
UPGRADE
read this https://github.com/laravel/passport/blob/11.x/UPGRADE.mdRemove this comment on this line on your AuthServiceProvider file.