class ClaimFactory

Constants

protected MANAGED_REFRESH_CLAIMS

Claims stamped by the factory itself when a token is refreshed.

protected RESERVED_CUSTOM_CLAIMS

Claims owned by the guard, manager, or claim factory.

Properties

static protected array $subjectModelHashes
protected string|null $issuer
protected bool $lockSubject

Methods

__construct(Repository $config)

Create a new claim factory.

array
make(Authenticatable $user, UserProvider $provider, int|null $ttl, array $customClaims = [])

Build claims for a newly issued token.

array
refresh(array $payload, int|null $ttl, bool $refreshIssuedAt, bool $resetClaims, array $persistentClaims, array $customClaims = [])

Build claims for a refreshed token.

mixed
subjectIdentifier(Authenticatable $user)

Determine the subject identifier for a user.

bool
subjectMatchesProvider(array $payload, UserProvider $provider)

Check whether a decoded token belongs to the configured provider model.

void
rejectReservedCustomClaims(array $claims)

Reject custom claims owned by the package.

array
withDefaults(array $claims, int|null $ttl)

Stamp standard claims, then apply caller claims on top.

string
subjectModelHash(string|object $model)

Hash the subject model class.

static void
flushState()

Flush all static state.

Details

at line 35
__construct(Repository $config)

Create a new claim factory.

Parameters

Repository $config

at line 47
array make(Authenticatable $user, UserProvider $provider, int|null $ttl, array $customClaims = [])

Build claims for a newly issued token.

Parameters

Authenticatable $user
UserProvider $provider
int|null $ttl
array $customClaims

Return Value

array

at line 77
array refresh(array $payload, int|null $ttl, bool $refreshIssuedAt, bool $resetClaims, array $persistentClaims, array $customClaims = [])

Build claims for a refreshed token.

Parameters

array $payload
int|null $ttl
bool $refreshIssuedAt
bool $resetClaims
array $persistentClaims
array $customClaims

Return Value

array

at line 115
mixed subjectIdentifier(Authenticatable $user)

Determine the subject identifier for a user.

Parameters

Authenticatable $user

Return Value

mixed

at line 125
bool subjectMatchesProvider(array $payload, UserProvider $provider)

Check whether a decoded token belongs to the configured provider model.

Parameters

array $payload
UserProvider $provider

Return Value

bool

at line 141
protected void rejectReservedCustomClaims(array $claims)

Reject custom claims owned by the package.

Parameters

array $claims

Return Value

void

at line 155
protected array withDefaults(array $claims, int|null $ttl)

Stamp standard claims, then apply caller claims on top.

Parameters

array $claims
int|null $ttl

Return Value

array

at line 178
protected string subjectModelHash(string|object $model)

Hash the subject model class.

Parameters

string|object $model

Return Value

string

at line 188
static void flushState()

Flush all static state.

Return Value

void