class User extends User

Traits

Notifiable
HasFactory

Properties

protected array $hidden

The attributes hidden from the model's JSON form.

protected array $casts

The attributes that should be casted to native types.

protected array $dates

The attributes that should be mutated to dates.

Methods

setJsonAttr(string $key, mixed $value, string $attrs = 'attrs')

Set a dynamic JSON attribute.

mixed
getJsonAttr(string $key, mixed $default = null, string $attrs = 'attrs')

Get a dynamic JSON attribute.

setEmailAttribute(string $value)

Set the email attribute and transform it to lowercase.

BelongsToMany
projects()

The projects, this user is a member of.

BelongsToMany
labelTrees()

The label trees, this user is a member of.

BelongsTo
role()

The global role of this user.

HasMany
apiTokens()

Api tokens of this user.

BelongsToMany
federatedSearchModels()

The federated search models that the user can access

bool
getIsGlobalAdminAttribute()

Determines if the user has the global admin role.

checkCanBeDeleted()

Checks if the user can be deleted.

setSettings(array $settings)

Set settings and merge them with the existing settings.

mixed
getSettings(string $key, mixed $default = null)

Get settings of a specific key.

array|null
getSettingsAttribute()

Get the settings array.

bool
getIsInSuperUserModeAttribute()

Determines if the user is currently in Super User Mode.

setIsInSuperUserModeAttribute(bool $value)

Enables or disables Super User Mode if the user is a global admin.

Details

in HasJsonAttributes at line 16
protected setJsonAttr(string $key, mixed $value, string $attrs = 'attrs')

Set a dynamic JSON attribute.

Parameters

string $key

Key of the attribute in the JSON.

mixed $value

Value of the attribute in the JSON.

string $attrs

Name of the JSON column of the model.

in HasJsonAttributes at line 38
protected mixed getJsonAttr(string $key, mixed $default = null, string $attrs = 'attrs')

Get a dynamic JSON attribute.

Parameters

string $key

Key of the attribute in the JSON.

mixed $default

Default value.

string $attrs

Name of the JSON column of the model.

Return Value

mixed

at line 48
setEmailAttribute(string $value)

Set the email attribute and transform it to lowercase.

Parameters

string $value

at line 58
BelongsToMany projects()

The projects, this user is a member of.

Return Value

BelongsToMany

at line 68
BelongsToMany labelTrees()

The label trees, this user is a member of.

Return Value

BelongsToMany

at line 78
BelongsTo role()

The global role of this user.

Return Value

BelongsTo

at line 88
HasMany apiTokens()

Api tokens of this user.

Return Value

HasMany

at line 98
BelongsToMany federatedSearchModels()

The federated search models that the user can access

Return Value

BelongsToMany

at line 108
bool getIsGlobalAdminAttribute()

Determines if the user has the global admin role.

Return Value

bool

at line 117
checkCanBeDeleted()

Checks if the user can be deleted.

Throws an exception if not.

at line 137
setSettings(array $settings)

Set settings and merge them with the existing settings.

Parameters

array $settings

at line 156
mixed getSettings(string $key, mixed $default = null)

Get settings of a specific key.

Parameters

string $key
mixed $default

Default value if the settings key was not set

Return Value

mixed

at line 166
array|null getSettingsAttribute()

Get the settings array.

Return Value

array|null

at line 176
bool getIsInSuperUserModeAttribute()

Determines if the user is currently in Super User Mode.

Return Value

bool

at line 185
setIsInSuperUserModeAttribute(bool $value)

Enables or disables Super User Mode if the user is a global admin.

Parameters

bool $value