class User extends User implements TwillModelContract (View source)

Traits

Authenticatable
Authorizable
Notifiable
SoftDeletes

Properties

protected $cropParamsKeys from  HasMedias
protected $presenterInstance from  HasPresenter
$translatedAttributes from  IsTranslatable
$timestamps
protected $casts
protected $fillable
protected $hidden
$checkboxes
array $mediasParams

Methods

array
getMediasParams()

No description

static void
bootHasMedias()

No description

MorphToMany
medias()

Defines the many-to-many relationship for media objects.

bool
hasImage(string $role, string $crop = 'default')

Checks if an image has been attached for a role and crop.

string|null
image(string $role, string $crop = 'default', array $params = [], bool $has_fallback = false, bool $cms = false, Media|null|bool $media = null)

Returns the URL of the attached image for a role and crop.

array
images(string $role, string $crop = 'default', array $params = [])

Returns an array of URLs of all attached images for a role and crop.

array
imagesWithCrops(string $role, array $params = [])

Returns an array of URLs of all attached images for a role, including all crops.

array
imageAsArray(string $role, string $crop = 'default', array $params = [], Media|null $media = null)

Returns an array of meta information for the image attached for a role and crop.

array
imagesAsArrays(string $role, string $crop = 'default', array $params = [])

Returns an array of meta information for all images attached for a role and crop.

array
imagesAsArraysWithCrops(string $role, array $params = [])

Returns an array of meta information for all images attached for a role, including all crops.

string
imageAltText(string $role, Media|null $media = null)

Returns the alt text of the image attached for a role.

string
imageCaption(string $role, Media|null $media = null)

Returns the caption of the image attached for a role.

string
imageVideo(string $role, Media|null $media = null)

Returns the video URL of the image attached for a role.

Media|null
imageObject(string $role, string $crop = 'default')

Returns the media object attached for a role and crop.

string|null
lowQualityImagePlaceholder(string $role, string $crop = 'default', array $params = [], bool $has_fallback = false)

Returns the LQIP base64 encoded string for a role.

string|null
socialImage(string $role, string $crop = 'default', array $params = [], bool $has_fallback = false)

Returns the URL of the social image for a role and crop.

string
cmsImage(string $role, string $crop = 'default', array $params = [])

Returns the URL of the CMS image for a role and crop.

string
defaultCmsImage(array $params = [])

Returns the URL of the default CMS image for this model.

Collection
imageObjects(string $role, string $crop = 'default')

Returns the media objects associated with a role and crop.

object
present(string $presenter = 'presenter')

No description

object
presentAdmin()

No description

$this
setPresenter(string $presenter, string $presenterProperty = 'presenter')

No description

$this
setPresenterAdmin(string $presenter)

No description

HasMany
providers()

No description

from  HasOauth
Model|false
linkProvider(User $oauthUser, string $provider)

No description

from  HasOauth
BelongsToMany
permissions()

This method should be clean of checks, the checks should happen earlier on.

void
grantGlobalPermission(string $name)

Add global permission to item, after making sure the permission is valid

void
revokeGlobalPermission(string $name)

Revoke global permission from the item, after making sure the permission is valid

void
grantModulePermission(string $name, string|object $permissionableType)

Add module permission to item, after making sure the permission is valid

void
revokeModulePermission(string $name, string|object $permissionableType)

Revoke module permission from the item, after making sure the permission is valid

void
revokeAllModulePermission(string|object $permissionableType)

Revoke all module permissions from the item

void
grantModuleItemPermission(string $name, object $permissionableItem)

Add module item permission, after making sure the permission is valid

void
revokeModuleItemPermission(string $name, object $permissionableItem)

Revoke module item permissions, after making sure the permission is valid

void
revokeModuleItemAllPermissions(object $permissionableItem)

Revoke all module item permissions

void
revokeAllPermissions()

Revoke all permissions

void
removePermissions(int[] $permissionableIds)

Revoke all permissions from a list of permission ids

void
checkPermissionAvailable(string $name, string $scope)

Check if a permission is available for a particular scope

bool
isTranslatable(null|array|string $columns = null)

Checks if this model is translatable.

__construct(array $attributes = [])

No description

Builder
scopeAccessible(Builder $query)

No description

static 
getRoleColumnName()

No description

getTitleInBrowserAttribute()

No description

getRoleValueAttribute()

No description

getCanDeleteAttribute()

No description

scopeActivated($query)

No description

scopePending($query)

No description

Builder
scopePublished(Builder $query)

No description

Builder
scopeDraft(Builder $query)

No description

Builder
scopeOnlyTrashed(Builder $query)

No description

scopeNotSuperAdmin($query)

No description

setImpersonating($id)

No description

stopImpersonating()

No description

isImpersonating()

No description

notifyWithCustomMarkdownTheme($instance)

No description

sendWelcomeNotification($token)

No description

sendPasswordResetNotification($token)

No description

isSuperAdmin()

No description

isPublished()

No description

isActivated()

No description

sendTemporaryPasswordNotification($password)

No description

sendPasswordResetByAdminNotification($password)

No description

groups()

No description

publishedGroups()

No description

role()

No description

allPermissions()

No description

setGoogle2faSecretAttribute($secret)

No description

getGoogle2faSecretAttribute($secret)

No description

generate2faSecretKey()

No description

get2faQrCode()

No description

array
getTranslatedAttributes()

No description

Details

array getMediasParams()

No description

Return Value

array

static void bootHasMedias()

No description

Return Value

void

MorphToMany medias()

Defines the many-to-many relationship for media objects.

Return Value

MorphToMany

bool hasImage(string $role, string $crop = 'default')

Checks if an image has been attached for a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

Return Value

bool

string|null image(string $role, string $crop = 'default', array $params = [], bool $has_fallback = false, bool $cms = false, Media|null|bool $media = null)

Returns the URL of the attached image for a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

array $params

Parameters compatible with the current image service, like w or h.

bool $has_fallback

Indicate that you can provide a fallback. Will return null instead of the default image fallback.

bool $cms

Indicate that you are displaying this image in the CMS views.

Media|null|bool $media

Provide a media object if you already retrieved one to prevent more SQL queries.

Return Value

string|null

array images(string $role, string $crop = 'default', array $params = [])

Returns an array of URLs of all attached images for a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

array $params

Parameters compatible with the current image service, like w or h.

Return Value

array

array imagesWithCrops(string $role, array $params = [])

Returns an array of URLs of all attached images for a role, including all crops.

Parameters

string $role

Role name.

array $params

Parameters compatible with the current image service, like w or h.

Return Value

array

array imageAsArray(string $role, string $crop = 'default', array $params = [], Media|null $media = null)

Returns an array of meta information for the image attached for a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

array $params

Parameters compatible with the current image service, like w or h.

Media|null $media

Provide a media object if you already retrieved one to prevent more SQL queries.

Return Value

array

array imagesAsArrays(string $role, string $crop = 'default', array $params = [])

Returns an array of meta information for all images attached for a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

array $params

Parameters compatible with the current image service, like w or h.

Return Value

array

array imagesAsArraysWithCrops(string $role, array $params = [])

Returns an array of meta information for all images attached for a role, including all crops.

Parameters

string $role

Role name.

array $params

Parameters compatible with the current image service, like w or h.

Return Value

array

string imageAltText(string $role, Media|null $media = null)

Returns the alt text of the image attached for a role.

Parameters

string $role

Role name.

Media|null $media

Provide a media object if you already retrieved one to prevent more SQL queries.

Return Value

string

string imageCaption(string $role, Media|null $media = null)

Returns the caption of the image attached for a role.

Parameters

string $role

Role name.

Media|null $media

Provide a media object if you already retrieved one to prevent more SQL queries.

Return Value

string

string imageVideo(string $role, Media|null $media = null)

Returns the video URL of the image attached for a role.

Parameters

string $role

Role name.

Media|null $media

Provide a media object if you already retrieved one to prevent more SQL queries.

Return Value

string

Media|null imageObject(string $role, string $crop = 'default')

Returns the media object attached for a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

Return Value

Media|null

string|null lowQualityImagePlaceholder(string $role, string $crop = 'default', array $params = [], bool $has_fallback = false)

Returns the LQIP base64 encoded string for a role.

Use this in conjunction with the RefreshLQIP Artisan command.

Parameters

string $role

Role name.

string $crop

Crop name.

array $params

Parameters compatible with the current image service, like w or h.

bool $has_fallback

Indicate that you can provide a fallback. Will return null instead of the default image fallback.

Return Value

string|null

See also

RefreshLQIP

string|null socialImage(string $role, string $crop = 'default', array $params = [], bool $has_fallback = false)

Returns the URL of the social image for a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

array $params

Parameters compatible with the current image service, like w or h.

bool $has_fallback

Indicate that you can provide a fallback. Will return null instead of the default image fallback.

Return Value

string|null

string cmsImage(string $role, string $crop = 'default', array $params = [])

Returns the URL of the CMS image for a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

array $params

Parameters compatible with the current image service, like w or h.

Return Value

string

string defaultCmsImage(array $params = [])

Returns the URL of the default CMS image for this model.

Parameters

array $params

Parameters compatible with the current image service, like w or h.

Return Value

string

Collection imageObjects(string $role, string $crop = 'default')

Returns the media objects associated with a role and crop.

Parameters

string $role

Role name.

string $crop

Crop name.

Return Value

Collection

object present(string $presenter = 'presenter')

No description

Parameters

string $presenter

Return Value

object

object presentAdmin()

No description

Return Value

object

$this setPresenter(string $presenter, string $presenterProperty = 'presenter')

No description

Parameters

string $presenter
string $presenterProperty

Return Value

$this

$this setPresenterAdmin(string $presenter)

No description

Parameters

string $presenter

Return Value

$this

HasMany providers()

No description

Return Value

HasMany

Model|false linkProvider(User $oauthUser, string $provider)

No description

Parameters

User $oauthUser
string $provider

Socialite provider

Return Value

Model|false

BelongsToMany permissions()

This method should be clean of checks, the checks should happen earlier on.

Return Value

BelongsToMany

void grantGlobalPermission(string $name)

Add global permission to item, after making sure the permission is valid

Parameters

string $name

Return Value

void

void revokeGlobalPermission(string $name)

Revoke global permission from the item, after making sure the permission is valid

Parameters

string $name

Return Value

void

void grantModulePermission(string $name, string|object $permissionableType)

Add module permission to item, after making sure the permission is valid

Parameters

string $name
string|object $permissionableType

Return Value

void

void revokeModulePermission(string $name, string|object $permissionableType)

Revoke module permission from the item, after making sure the permission is valid

Parameters

string $name
string|object $permissionableType

Return Value

void

void revokeAllModulePermission(string|object $permissionableType)

Revoke all module permissions from the item

Parameters

string|object $permissionableType

Return Value

void

void grantModuleItemPermission(string $name, object $permissionableItem)

Add module item permission, after making sure the permission is valid

Parameters

string $name
object $permissionableItem

Return Value

void

void revokeModuleItemPermission(string $name, object $permissionableItem)

Revoke module item permissions, after making sure the permission is valid

Parameters

string $name
object $permissionableItem

Return Value

void

void revokeModuleItemAllPermissions(object $permissionableItem)

Revoke all module item permissions

Parameters

object $permissionableItem

Return Value

void

void revokeAllPermissions()

Revoke all permissions

Return Value

void

void removePermissions(int[] $permissionableIds)

Revoke all permissions from a list of permission ids

Parameters

int[] $permissionableIds

Return Value

void

protected void checkPermissionAvailable(string $name, string $scope)

Check if a permission is available for a particular scope

Parameters

string $name
string $scope

Return Value

void

See also

Permission::SCOPE_GLOBAL
Permission::SCOPE_MODULE
Permission::SCOPE_ITEM

bool isTranslatable(null|array|string $columns = null)

Checks if this model is translatable.

If no columns/column is provided it will return true if the model itself is translatable.

Parameters

null|array|string $columns

Return Value

bool

__construct(array $attributes = [])

No description

Parameters

array $attributes

Builder scopeAccessible(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

static getRoleColumnName()

No description

getTitleInBrowserAttribute()

No description

getRoleValueAttribute()

No description

getCanDeleteAttribute()

No description

scopeActivated($query)

No description

Parameters

$query

scopePending($query)

No description

Parameters

$query

Builder scopePublished(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

Builder scopeDraft(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

Builder scopeOnlyTrashed(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

scopeNotSuperAdmin($query)

No description

Parameters

$query

setImpersonating($id)

No description

Parameters

$id

stopImpersonating()

No description

isImpersonating()

No description

notifyWithCustomMarkdownTheme($instance)

No description

Parameters

$instance

sendWelcomeNotification($token)

No description

Parameters

$token

sendPasswordResetNotification($token)

No description

Parameters

$token

isSuperAdmin()

No description

isPublished()

No description

isActivated()

No description

sendTemporaryPasswordNotification($password)

No description

Parameters

$password

sendPasswordResetByAdminNotification($password)

No description

Parameters

$password

groups()

No description

publishedGroups()

No description

role()

No description

allPermissions()

No description

getLastLoginColumnValueAttribute()

No description

setGoogle2faSecretAttribute($secret)

No description

Parameters

$secret

getGoogle2faSecretAttribute($secret)

No description

Parameters

$secret

generate2faSecretKey()

No description

get2faQrCode()

No description

array getTranslatedAttributes()

No description

Return Value

array