class User extends User implements JWTSubject (View source)

Class User.

Represents a system user with authentication via JWT. Handles encrypted email storage, password hashing, and relations with password reset codes.

Properties

bool $incrementing

Indicates if the IDs are auto-incrementing.

bool $timestamps

Indicates if the model should not use timestamps.

protected string $table

The database table associated with the model.

protected string $keyType

The primary key type.

protected array<int,string> $fillable

The attributes that are mass assignable.

protected array<int,string> $hidden

The attributes that should be hidden for arrays.

Methods

string|null
getIdAttribute(null|string $value)

Get the UUID string of the user's ID.

void
setEmailAttribute(string $value)

Encrypt and store the user's email, and store its hash for lookup.

string|null
getEmailAttribute(string|null $value)

Decrypt the stored email.

void
setPasswordAttribute(string $value)

Hash and store the password securely.

HasMany
passwordResetCodes()

Relationship: User has many password reset codes.

null|string
getJWTIdentifier()

Get the identifier for JWT (primary key).

array
getJWTCustomClaims()

Return a key-value array of custom JWT claims.

string
getAuthPassword()

Get the password for authentication.

static void
boot()

Boot method to generate UUID before creating a new user.

Details

string|null getIdAttribute(null|string $value)

Get the UUID string of the user's ID.

Parameters

null|string $value

Binary UUID

Return Value

string|null

String UUID

void setEmailAttribute(string $value)

Encrypt and store the user's email, and store its hash for lookup.

Parameters

string $value

Return Value

void

string|null getEmailAttribute(string|null $value)

Decrypt the stored email.

Parameters

string|null $value

Return Value

string|null

void setPasswordAttribute(string $value)

Hash and store the password securely.

Parameters

string $value

Return Value

void

HasMany passwordResetCodes()

Relationship: User has many password reset codes.

Return Value

HasMany

null|string getJWTIdentifier()

Get the identifier for JWT (primary key).

Return Value

null|string

array getJWTCustomClaims()

Return a key-value array of custom JWT claims.

Return Value

array

string getAuthPassword()

Get the password for authentication.

Return Value

string

static protected void boot()

Boot method to generate UUID before creating a new user.

Return Value

void