Documentation

Setting extends Model implements ModelOwnership, DynamicallyCastsTypes Uses HasOwner, AliasesSnakeCaseAttributes

Setting

Tags
mixin

Builder

Interfaces, Classes, Traits and Enums

ModelOwnership
ModelOwnership
DynamicallyCastsTypes
DynamicallyCastsTypes

Table of Contents

$data_type  : DataType|null
$dataType  : DataType|null
$id  : int
$owner  : mixed
$setting_type  : SettingType|null
$settingType  : SettingType|null
$value  : mixed
$casts  : mixed
$fillable  : mixed
belongsToModel()  : bool
getAttribute()  : mixed
getConnection()  : Connection
Get the database connection for the model.
getDataType()  : DataType
Get the DataType for this Model.
getTable()  : string
Get the table associated with the model.
hasOwner()  : bool
isAppSetting()  : bool
Is this an App setting?
isGlobalSetting()  : bool
Is this a Global setting?
isModelSetting()  : bool
Is this a Model setting?
isSettingType()  : bool
Check if this is the same SettingType as given.
isUserSetting()  : bool
Is this a User setting?
modelFromArray()  : Model|null
Get a new model instance from an array.
modelFromJson()  : Model|null
Get a new model instance from JSON.
morphTo()  : MorphTo
Define a polymorphic, inverse one-to-one or many relationship.
newCollection()  : SettingsCollection
owner()  : MorphTo
setAttribute()  : mixed
setOwner()  : static

Properties

$casts

protected mixed $casts = ['data_type' => \Envorra\LaravelSettings\Enums\DataType::class, 'setting_type' => \Envorra\LaravelSettings\Enums\SettingType::class, 'value' => \Envorra\LaravelSettings\Casters\DynamicTypeCaster::class]
Tags
inheritDoc

$fillable

protected mixed $fillable = ['key', 'description', 'data_type', 'value']
Tags
inheritdoc

Methods

belongsToModel()

public belongsToModel(Model $model) : bool
Parameters
$model : Model
Tags
inheritDoc
Return values
bool

getAttribute()

public getAttribute(mixed $key) : mixed
Parameters
$key : mixed
Tags
inheritDoc
Return values
mixed

getConnection()

Get the database connection for the model.

public abstract getConnection() : Connection
Tags
noinspection

PhpMissingReturnTypeInspection

Return values
Connection

getDataType()

Get the DataType for this Model.

public getDataType() : DataType
Tags
inheritDoc
Return values
DataType

getTable()

Get the table associated with the model.

public abstract getTable() : string
Tags
noinspection

PhpMissingReturnTypeInspection

Return values
string

hasOwner()

public hasOwner() : bool
Tags
inheritDoc
Return values
bool

isAppSetting()

Is this an App setting?

public isAppSetting() : bool
Return values
bool

isGlobalSetting()

Is this a Global setting?

public isGlobalSetting() : bool
Return values
bool

isModelSetting()

Is this a Model setting?

public isModelSetting() : bool
Return values
bool

isSettingType()

Check if this is the same SettingType as given.

public isSettingType(SettingType|string|array<string|int, mixed> $type) : bool
Parameters
$type : SettingType|string|array<string|int, mixed>
Return values
bool

isUserSetting()

Is this a User setting?

public isUserSetting() : bool
Return values
bool

modelFromArray()

Get a new model instance from an array.

public static modelFromArray(array<string|int, mixed> $attributes) : Model|null
Parameters
$attributes : array<string|int, mixed>
Return values
Model|null

modelFromJson()

Get a new model instance from JSON.

public static modelFromJson(string $json) : Model|null
Parameters
$json : string
Return values
Model|null

morphTo()

Define a polymorphic, inverse one-to-one or many relationship.

public abstract morphTo([string|null $name = null ][, string|null $type = null ][, string|null $id = null ][, string|null $ownerKey = null ]) : MorphTo
Parameters
$name : string|null = null
$type : string|null = null
$id : string|null = null
$ownerKey : string|null = null
Tags
noinspection

PhpMissingReturnTypeInspection

Return values
MorphTo

owner()

public owner() : MorphTo
Tags
inheritDoc
Return values
MorphTo

setAttribute()

public setAttribute(mixed $key, mixed $value) : mixed
Parameters
$key : mixed
$value : mixed
Tags
inheritDoc
Return values
mixed

setOwner()

public setOwner(Model $owner) : static
Parameters
$owner : Model
Tags
inheritDoc
Return values
static

Search results