laravel / passport

Laravel Passport provides OAuth2 server support to Laravel.
https://laravel.com/docs/passport
MIT License
3.25k stars 780 forks source link

[12.x] Make Passport's database connection configurable #1738

Closed axlon closed 2 months ago

axlon commented 2 months ago

This PR allows developers to configure Passport's database connection without having to extend all of Passport's models.

This change should be fully backwards compatible because:

axlon commented 2 months ago

I just realized Passport's ClientFactory always points to Passport's version of the client model. If someone were to extend the Client model to adjust the connection (which is what prompted me to create this PR) it makes the client factory unusable.

This PR fixes that issue as well, but long term it probably makes more sense to make ClientFactory use Passport::clientModel() to always use the correct model