Fix support for authorization using sanctum tokens

This commit is contained in:
Dane Everitt 2021-07-28 21:05:23 -07:00
parent 1a3451fb0d
commit 374910d73a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 24 additions and 1 deletions

View file

@ -36,6 +36,17 @@ class PersonalAccessToken extends Model implements HasAbilities
return $this->belongsTo(User::class);
}
/**
* Required for support with Laravel Sanctum.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
* @see \Laravel\Sanctum\Guard::supportsTokens()
*/
public function tokenable()
{
return $this->user();
}
/**
* Determine if the token has a given ability.
*