class Setting extends Model (View source)

Traits

Translatable
SoftDeletes
TaggableTrait

Properties

protected $presenterInstance from  HasPresenter
$translatedAttributes
$timestamps from  Model
protected $cropParamsKeys from  HasMedias
$useTranslationFallback
protected $fillable

Methods

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

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

Checks if this model is translatable.

bool
isTranslationModel()

No description

from  Model
Builder
scopePublished(Builder $query)

No description

from  Model
Builder
scopeAccessible(Builder $query)

No description

from  Model
Builder
scopePublishedInListings(Builder $query)

No description

from  Model
Builder
scopeVisible(Builder $query)

No description

from  Model
void
setPublishStartDateAttribute($value)

No description

from  Model
Builder
scopeDraft(Builder $query)

No description

from  Model
Builder
scopeOnlyTrashed(Builder $query)

No description

from  Model
array
getFillable()

No description

from  Model
array
getTranslatedAttributes()

No description

from  Model
static void
bootTaggableTrait()

No description

from  Model
MorphToMany
tags()

No description

from  Model
string
getFullUrl()

This method should return the full url. By default this will be based on the controller slug or urlWithoutSlug. But it can be overwritten in order to fully customize the link.

from  Model
Builder
scopeWithActiveTranslations(Builder $query, string|null $locale = null)

No description

Builder
scopeOrderByTranslation(Builder $query, string $orderField, string $orderType = 'ASC', string|null $locale = null)

No description

Builder
scopeOrderByRawByTranslation(Builder $query, string $orderRawString, string $groupByField, string|null $locale = null)

No description

bool
hasActiveTranslation(string|null $locale = null)

Checks if this model has active translations.

Collection
getActiveLanguages()

No description

Collection
translatedAttribute(string $key)

Returns all translations for a given attribute.

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.

getTable()

No description

string
getTranslationRelationKey()

No description

Details

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

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

protected bool isTranslationModel()

No description

Return Value

bool

Builder scopePublished(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

Builder scopeAccessible(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

Builder scopePublishedInListings(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

Builder scopeVisible(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

void setPublishStartDateAttribute($value)

No description

Parameters

$value

Return Value

void

Builder scopeDraft(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

Builder scopeOnlyTrashed(Builder $query)

No description

Parameters

Builder $query

Return Value

Builder

array getFillable()

No description

Return Value

array

array getTranslatedAttributes()

No description

Return Value

array

static protected void bootTaggableTrait()

No description

Return Value

void

MorphToMany tags()

No description

Return Value

MorphToMany

string getFullUrl()

This method should return the full url. By default this will be based on the controller slug or urlWithoutSlug. But it can be overwritten in order to fully customize the link.

This link is used by for example TwillUtil::parseInternalLinks

Return Value

string

getTranslationModelNameDefault()

No description

Builder scopeWithActiveTranslations(Builder $query, string|null $locale = null)

No description

Parameters

Builder $query
string|null $locale

Return Value

Builder

Builder scopeOrderByTranslation(Builder $query, string $orderField, string $orderType = 'ASC', string|null $locale = null)

No description

Parameters

Builder $query
string $orderField
string $orderType
string|null $locale

Return Value

Builder

Builder scopeOrderByRawByTranslation(Builder $query, string $orderRawString, string $groupByField, string|null $locale = null)

No description

Parameters

Builder $query
string $orderRawString
string $groupByField
string|null $locale

Return Value

Builder

bool hasActiveTranslation(string|null $locale = null)

Checks if this model has active translations.

Parameters

string|null $locale

Return Value

bool

Collection getActiveLanguages()

No description

Return Value

Collection

Collection translatedAttribute(string $key)

Returns all translations for a given attribute.

Parameters

string $key

Return Value

Collection

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

getTable()

No description

protected string getTranslationRelationKey()

No description

Return Value

string