class
Illuminate
/
Database
/
Eloquent
/
Casts
/
Attribute
You are viewing an older version of the documentation. For the latest, please visit master documentation.
Attribute
Properties
public
$get callable
The attribute accessor.
Default: null
public
$set callable
The attribute mutator.
Default: null
public
$withObjectCaching bool
Indicates if caching of objects is enabled for this attribute.
Default: true
Methods
public
__construct ( callable $get , callable $set ) : void
Create a new attribute accessor / mutator.
Parameters
- $get callable|null
- $set callable|null
public
static
get ( callable $get ) : static
Create a new attribute accessor.
Parameters
- $get callable
public
static
set ( callable $set ) : static
Create a new attribute mutator.
Parameters
- $set callable
public
withoutObjectCaching ( ) : static
Disable object caching for the attribute.