class Attribute extends Model implements Attribute

Properties

boolean $timestamps Indicates if the model should be timestamped.
array $attributes array$attributes

Methods

__construct(string|array $key = null, mixed $value = null)

Create new attribute instance.

newBag(array $models = array())

Create new AttributeBag.

mixed
getValue()

Get the meta attribute value.

string
getMetaKey()

Get the meta attribute key.

setValue(mixed $value)

Set value of the meta attribute.

string
getTable()

Allow custom table name for meta attributes via config.

static 
setCustomTable(string $table)

Set custom table for the meta attributes. Allows doing it only once in order to mimic protected behaviour, most likely in the service provider, which in turn gets the table name from configuration.

string
castToString()

Handle casting value to string.

string
__toString()

Handle dynamic casting to string.

Details

at line 81
__construct(string|array $key = null, mixed $value = null)

Create new attribute instance.

Parameters

string|array $key
mixed $value

at line 134
AttributeBag newBag(array $models = array())

Create new AttributeBag.

Parameters

array $models

Return Value

AttributeBag

at line 144
mixed getValue()

Get the meta attribute value.

Return Value

mixed

at line 158
string getMetaKey()

Get the meta attribute key.

Return Value

string

at line 216
setValue(mixed $value)

Set value of the meta attribute.

Parameters

mixed $value

Exceptions

InvalidTypeException

at line 326
string getTable()

Allow custom table name for meta attributes via config.

Return Value

string

at line 338
static setCustomTable(string $table)

Set custom table for the meta attributes. Allows doing it only once in order to mimic protected behaviour, most likely in the service provider, which in turn gets the table name from configuration.

Parameters

string $table

at line 350
string castToString()

Handle casting value to string.

Return Value

string

at line 370
string __toString()

Handle dynamic casting to string.

Return Value

string