diff --git a/src/Client.php b/src/Client.php index 8e16fa9c9..6165526cd 100644 --- a/src/Client.php +++ b/src/Client.php @@ -61,6 +61,18 @@ public function tokens() return $this->hasMany(Passport::tokenModel(), 'client_id'); } + /** + * Get the user that the client belongs to. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function user() + { + $provider = config('auth.guards.api.provider'); + + return $this->belongsTo(config('auth.providers.'.$provider.'.model')); + } + /** * Determine if the client is a "first party" client. *