Constants

ACTIVATION_TOKEN_LENGTH

ACTIVATION_TOKEN_LENGTH

STATUS_INACTIVE

STATUS_INACTIVE

STATUS_ACTIVE

STATUS_ACTIVE

STATUS_BANNED

STATUS_BANNED

SCOPE_PUBLIC

SCOPE_PUBLIC

SCOPE_UNLIMITED

SCOPE_UNLIMITED

SCOPE_BANNED

SCOPE_BANNED

Properties

$id

$id : integer

Type

integer

$username

$username : string

Type

string

$email

$email : string

Type

string

$password

$password : string

Type

string

$activation_token

$activation_token : string

Type

string

$display_name

$display_name : string

Type

string

$is_admin

$is_admin : integer

Type

integer

$options

$options : array

Type

array

$status

$status : integer

0 == inactive, 1 == active, 2 == banned

Type

integer

$description

$description : string|null

Type

string|null

$remember_token

$remember_token : string|null

Type

string|null

$created_at

$created_at : \Carbon\Carbon|null

Type

\Carbon\Carbon|null

$updated_at

$updated_at : \Carbon\Carbon|null

Type

\Carbon\Carbon|null

$profile_image_id

$profile_image_id : integer|null

Type

integer|null

$bought

$bought : \Illuminate\Database\Eloquent\Collection|array<mixed,\App\Offer>

Type

\Illuminate\Database\Eloquent\Collection|array<mixed,\App\Offer>

$locale

$locale : string

Type

string

$notifications

$notifications : \Illuminate\Notifications\DatabaseNotificationCollection|array<mixed,\Illuminate\Notifications\DatabaseNotification>

Type

\Illuminate\Notifications\DatabaseNotificationCollection|array<mixed,\Illuminate\Notifications\DatabaseNotification>

$offers

$offers : \Illuminate\Database\Eloquent\Collection|array<mixed,\App\Offer>

Type

\Illuminate\Database\Eloquent\Collection|array<mixed,\App\Offer>

$profile_image

$profile_image : \App\Image|null

Type

\App\Image|null

$fillable

$fillable : array

The attributes that are mass assignable.

Type

array

$hidden

$hidden : array

The attributes that should be hidden for arrays.

Type

array

$with

$with : 

Type

$casts

$casts : 

Type

Methods

getDisplayNameAttribute()

getDisplayNameAttribute() : string

Get a display name or fallback to the username if not provided.

Returns

string

getLocaleAttribute()

getLocaleAttribute() : string

Get the user's preferred locale

Returns

string

sendPasswordResetNotification()

sendPasswordResetNotification(  $token) 

Parameters

$token

sendRegistrationActivateNotification()

sendRegistrationActivateNotification() 

Send the registration activation e-mail notification.

activate()

activate(  $token = null) : boolean

Sets the user's status to active.

Returns false if the user is banned, already active, or if $token does not match the user's activation_token.

Parameters

$token

Returns

boolean

getValidationRules()

getValidationRules(boolean  $updating = false) : array

Get validation rules for a creation request.

Parameters

boolean $updating

Returns

array

offers()

offers() : \Illuminate\Database\Eloquent\Relations\HasMany

Relation to the offers owned by the user.

Returns

\Illuminate\Database\Eloquent\Relations\HasMany

bought()

bought() : \Illuminate\Database\Eloquent\Relations\HasMany

Relation to the offers bought by the user.

Returns

\Illuminate\Database\Eloquent\Relations\HasMany

profile_image()

profile_image() : \Illuminate\Database\Eloquent\Relations\BelongsTo

Relation to the profile image

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo

inactiveRemovedFromTimestamp()

inactiveRemovedFromTimestamp() : \Carbon\Carbon

Returns the date that inactive users have to be newer than to not be removed

Returns

\Carbon\Carbon

bannedRemovedFromTimestamp()

bannedRemovedFromTimestamp() : \Carbon\Carbon

Returns the date that banned users have to be newer than to not be removed

Returns

\Carbon\Carbon

scopeToBeRemoved()

scopeToBeRemoved(\Illuminate\Database\Eloquent\Builder  $query) : \Illuminate\Database\Eloquent\Builder

Limits the query to only return items that should be removed

Parameters

\Illuminate\Database\Eloquent\Builder $query

Returns

\Illuminate\Database\Eloquent\Builder

scopePublic()

scopePublic(\Illuminate\Database\Eloquent\Builder  $query) : \Illuminate\Database\Eloquent\Builder

Limits the query to only return users that are active

Parameters

\Illuminate\Database\Eloquent\Builder $query

Returns

\Illuminate\Database\Eloquent\Builder

scopeUnlimited()

scopeUnlimited(\Illuminate\Database\Eloquent\Builder  $query) : \Illuminate\Database\Eloquent\Builder

Does not limit the query

Parameters

\Illuminate\Database\Eloquent\Builder $query

Returns

\Illuminate\Database\Eloquent\Builder

scopeBanned()

scopeBanned(\Illuminate\Database\Eloquent\Builder  $query) : \Illuminate\Database\Eloquent\Builder

Limits the query to only return users that are banned

Parameters

\Illuminate\Database\Eloquent\Builder $query

Returns

\Illuminate\Database\Eloquent\Builder

getPublicScopes()

getPublicScopes() : array<mixed,string>

Returns a list of scopes that can be used from outside of the app

Returns

array<mixed,string>

canUsePublicScope()

canUsePublicScope(string  $scopeName, \App\User|null  $user = null) : boolean

Returns whether a certain user can use a particular scope

Parameters

string $scopeName
\App\User|null $user

Returns

boolean

validatePublicScopeParams()

validatePublicScopeParams(string  $scopeName, array<mixed,string>  $columnNames) : boolean

Determines whether the user is allowed to additionally limit his query with provided column names when requesting a particular scope

Parameters

string $scopeName
array<mixed,string> $columnNames

Returns

boolean

toSearchableArray()

toSearchableArray() 

banned()

banned() : \Illuminate\Database\Eloquent\Builder|\App\User

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

public()

public() : \Illuminate\Database\Eloquent\Builder|\App\User

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

unlimited()

unlimited() : \Illuminate\Database\Eloquent\Builder|\App\User

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

toBeRemoved()

toBeRemoved() : \Illuminate\Database\Eloquent\Builder|\App\User

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereActivationToken()

whereActivationToken(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereCreatedAt()

whereCreatedAt(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereDescription()

whereDescription(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereDisplayName()

whereDisplayName(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereEmail()

whereEmail(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereId()

whereId(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereIsAdmin()

whereIsAdmin(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereOptions()

whereOptions(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

wherePassword()

wherePassword(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereProfileImageId()

whereProfileImageId(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereRememberToken()

whereRememberToken(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereStatus()

whereStatus(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereUpdatedAt()

whereUpdatedAt(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

whereUsername()

whereUsername(mixed  $value) : \Illuminate\Database\Eloquent\Builder|\App\User

Parameters

mixed $value

Returns

\Illuminate\Database\Eloquent\Builder|\App\User

boot()

boot()