interface HasApiTokens

Methods

tokens()

Get the access tokens that belong to model.

bool
tokenCan(UnitEnum|string $ability)

Determine if the current API token has a given ability.

bool
tokenCant(UnitEnum|string $ability)

Determine if the current API token is missing a given ability.

createToken(string $name, array $abilities = ['*'], DateTimeInterface|null $expiresAt = null)

Create a new personal access token for the user.

currentAccessToken()

Get the access token currently associated with the user.

withAccessToken(HasAbilities|null $accessToken)

Set the current access token for the user.

Details

at line 16
MorphMany tokens()

Get the access tokens that belong to model.

Return Value

MorphMany

at line 21
bool tokenCan(UnitEnum|string $ability)

Determine if the current API token has a given ability.

Parameters

UnitEnum|string $ability

Return Value

bool

at line 26
bool tokenCant(UnitEnum|string $ability)

Determine if the current API token is missing a given ability.

Parameters

UnitEnum|string $ability

Return Value

bool

at line 33
NewAccessToken createToken(string $name, array $abilities = ['*'], DateTimeInterface|null $expiresAt = null)

Create a new personal access token for the user.

Parameters

string $name
array $abilities
DateTimeInterface|null $expiresAt

Return Value

NewAccessToken

at line 38
HasAbilities|null currentAccessToken()

Get the access token currently associated with the user.

Return Value

HasAbilities|null

at line 45
HasApiTokens withAccessToken(HasAbilities|null $accessToken)

Set the current access token for the user.

Parameters

HasAbilities|null $accessToken

Return Value

HasApiTokens