Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider Getting Model Name from Passport #7

Closed
lloy0076 opened this issue Mar 28, 2019 · 0 comments
Closed

Consider Getting Model Name from Passport #7

lloy0076 opened this issue Mar 28, 2019 · 0 comments

Comments

@lloy0076
Copy link

$client = DB::table('oauth_clients')

One can ask Passport for the client name or model.

https://github.com/laravel/passport/blob/5e4f98db1c801c3f05b3039270d4cd9cd09fa3fc/src/Passport.php#L476

https://github.com/laravel/passport/blob/5e4f98db1c801c3f05b3039270d4cd9cd09fa3fc/src/Passport.php#L486

    /**
     * Get a new client model instance.
     *
     * @return \Laravel\Passport\Client
     */
    public static function client()
    {
        return new static::$clientModel;
    }

You probably want the latter; it's technically less likely to fall over (although I don't see upstream renaming the oauth_* tables any time soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant