trait HasApiTokens

Properties

protected ScopeAuthorizable|null $accessToken

The current access token for the authentication user.

Methods

oauthApps()

Get all of the user's registered OAuth applications.

oauthConsents()

Get the user's OAuth authorizations.

tokens()

Get all of the access tokens for the user.

token()

Get the access token currently associated with the user.

currentAccessToken()

Get the access token currently associated with the user.

bool
tokenCan(string $scope)

Determine if the current API token has a given scope.

bool
tokenCant(string $scope)

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

createToken(string $name, array $scopes = [])

Create a new personal access token for the user.

string
getProviderName()

Get the user provider name.

withAccessToken(ScopeAuthorizable|null $accessToken)

Set the current access token for the user.

Details

at line 29
ClientRelation oauthApps()

Get all of the user's registered OAuth applications.

Return Value

ClientRelation

at line 49
HasMany oauthConsents()

Get the user's OAuth authorizations.

Return Value

HasMany

at line 66
TokenRelation tokens()

Get all of the access tokens for the user.

Return Value

TokenRelation

at line 82
ScopeAuthorizable|null token()

Get the access token currently associated with the user.

Return Value

ScopeAuthorizable|null

at line 90
ScopeAuthorizable|null currentAccessToken()

Get the access token currently associated with the user.

Return Value

ScopeAuthorizable|null

at line 98
bool tokenCan(string $scope)

Determine if the current API token has a given scope.

Parameters

string $scope

Return Value

bool

at line 106
bool tokenCant(string $scope)

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

Parameters

string $scope

Return Value

bool

at line 116
PersonalAccessTokenResult createToken(string $name, array $scopes = [])

Create a new personal access token for the user.

Parameters

string $name
array $scopes

Return Value

PersonalAccessTokenResult

at line 131
string getProviderName()

Get the user provider name.

Return Value

string

Exceptions

LogicException

at line 152
HasApiTokens withAccessToken(ScopeAuthorizable|null $accessToken)

Set the current access token for the user.

Parameters

ScopeAuthorizable|null $accessToken

Return Value

HasApiTokens