PHP Класс BookStack\User

Наследование: extends Model, implements Illuminate\Contracts\Auth\Authenticatable, implements Illuminate\Contracts\Auth\CanResetPassword, use trait Illuminate\Auth\Authenticatable, use trait Illuminate\Auth\Passwords\CanResetPassword, use trait Illuminate\Notifications\Notifiable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$fillable array The attributes that are mass assignable.
$hidden array The attributes excluded from the model's JSON form.
$permissions array This holds the user's permissions when loaded.
$table string The database table used by the model.

Открытые методы

Метод Описание
attachRole ( Role $role ) Attach a role to this user.
attachRoleId ( $id ) Attach a role id to this user.
avatar ( ) : BelongsTo Get the avatar for the user.
can ( $permissionName ) : boolean Check if the user has a particular permission.
getAvatar ( integer $size = 50 ) : string Returns the user's avatar,
getDefault ( ) : User Returns the default public user.
getEditUrl ( ) : string Get the url for editing this user.
getProfileUrl ( ) : mixed Get the url that links to this user's profile.
getShortName ( integer $chars = 8 ) : string Get a shortened version of the user's name.
hasRole ( $role ) : mixed Check if the user has a role.
hasSocialAccount ( boolean | string $socialDriver = false ) : boolean Check if the user has a social account, If a driver is passed it checks for that single account type.
isDefault ( ) : boolean Check if the user is the default public user.
permissions ( boolean $cache = true ) : Illuminate\Database\Eloquent\Relations\HasManyThrough Get all permissions belonging to a the current user.
roles ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany The roles that belong to the user.
sendPasswordResetNotification ( string $token ) : void Send the password reset notification.
socialAccounts ( ) : Illuminate\Database\Eloquent\Relations\HasMany Get the social account associated with this user.

Описание методов

attachRole() публичный Метод

Attach a role to this user.
public attachRole ( Role $role )
$role Role

attachRoleId() публичный Метод

Attach a role id to this user.
public attachRoleId ( $id )
$id

avatar() публичный Метод

Get the avatar for the user.
public avatar ( ) : BelongsTo
Результат Illuminate\Database\Eloquent\Relations\BelongsTo

can() публичный Метод

Check if the user has a particular permission.
public can ( $permissionName ) : boolean
$permissionName
Результат boolean

getAvatar() публичный Метод

Returns the user's avatar,
public getAvatar ( integer $size = 50 ) : string
$size integer
Результат string

getDefault() публичный статический Метод

Returns the default public user.
public static getDefault ( ) : User
Результат User

getEditUrl() публичный Метод

Get the url for editing this user.
public getEditUrl ( ) : string
Результат string

getProfileUrl() публичный Метод

Get the url that links to this user's profile.
public getProfileUrl ( ) : mixed
Результат mixed

getShortName() публичный Метод

Get a shortened version of the user's name.
public getShortName ( integer $chars = 8 ) : string
$chars integer
Результат string

hasRole() публичный Метод

Check if the user has a role.
public hasRole ( $role ) : mixed
$role
Результат mixed

hasSocialAccount() публичный Метод

Check if the user has a social account, If a driver is passed it checks for that single account type.
public hasSocialAccount ( boolean | string $socialDriver = false ) : boolean
$socialDriver boolean | string
Результат boolean

isDefault() публичный Метод

Check if the user is the default public user.
public isDefault ( ) : boolean
Результат boolean

permissions() публичный Метод

Get all permissions belonging to a the current user.
public permissions ( boolean $cache = true ) : Illuminate\Database\Eloquent\Relations\HasManyThrough
$cache boolean
Результат Illuminate\Database\Eloquent\Relations\HasManyThrough

roles() публичный Метод

The roles that belong to the user.
public roles ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
Результат Illuminate\Database\Eloquent\Relations\BelongsToMany

sendPasswordResetNotification() публичный Метод

Send the password reset notification.
public sendPasswordResetNotification ( string $token ) : void
$token string
Результат void

socialAccounts() публичный Метод

Get the social account associated with this user.
public socialAccounts ( ) : Illuminate\Database\Eloquent\Relations\HasMany
Результат Illuminate\Database\Eloquent\Relations\HasMany

Описание свойств

$fillable защищенное свойство

The attributes that are mass assignable.
protected array $fillable
Результат array

$hidden защищенное свойство

The attributes excluded from the model's JSON form.
protected array $hidden
Результат array

$permissions защищенное свойство

This holds the user's permissions when loaded.
protected array $permissions
Результат array

$table защищенное свойство

The database table used by the model.
protected string $table
Результат string