interface Principal

Contract the auth guard/provider relies on to authenticate a model without knowing its underlying schema. A Principal exposes its identifier, its stored password, and its remember-me token through a fixed set of accessors, along with the column names backing each, so the authentication system can operate against any model that maps these concepts to storage however it chooses.

Methods

string
getAuthIdentifierName()

Gets the name of the column that uniquely identifies the principal.

mixed
getAuthIdentifier()

Gets the principal's unique identifier value.

string|null
getAuthPasswordName()

Gets the name of the column that stores the principal's password, or null if the model has no password column.

string|null
getAuthPassword()

Gets the principal's stored (hashed) password.

string|null
getRememberToken()

Gets the principal's current remember-me token.

void
setRememberToken(string $value)

Sets the principal's remember-me token. Implementations for models that do not support remember-me may treat this as a no-op.

string|null
getRememberTokenName()

Gets the name of the column that stores the remember-me token, or null if the model does not support remember-me.

Details

at line 19
string getAuthIdentifierName()

Gets the name of the column that uniquely identifies the principal.

Return Value

string

The identifier column name (e.g. 'id').

at line 26
mixed getAuthIdentifier()

Gets the principal's unique identifier value.

Return Value

mixed

The value of the identifier column (e.g. the id).

at line 34
string|null getAuthPasswordName()

Gets the name of the column that stores the principal's password, or null if the model has no password column.

Return Value

string|null

The password column name, or null if none.

at line 41
string|null getAuthPassword()

Gets the principal's stored (hashed) password.

Return Value

string|null

The hashed password, or null if none is set.

at line 49
string|null getRememberToken()

Gets the principal's current remember-me token.

Return Value

string|null

The remember-me token, or null if the model does not support remember-me or no token is set.

at line 58
void setRememberToken(string $value)

Sets the principal's remember-me token. Implementations for models that do not support remember-me may treat this as a no-op.

Parameters

string $value

The token value to assign.

Return Value

void

at line 67
string|null getRememberTokenName()

Gets the name of the column that stores the remember-me token, or null if the model does not support remember-me.

Return Value

string|null

The remember-me token column name, or null if the model has no such column.