Fix support for authorization using sanctum tokens
This commit is contained in:
parent
1a3451fb0d
commit
374910d73a
2 changed files with 24 additions and 1 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue