class Attribute (View source)
| callable | $get | The attribute accessor. | |
| callable | $set | The attribute mutator. | |
| bool | $withCaching | Indicates if caching is enabled for this attribute. | |
| bool | $withObjectCaching | Indicates if caching of objects is enabled for this attribute. |
| void | __construct(callable|null $get = null, callable|null $set = null)
Create a new attribute accessor / mutator. | |
| static Attribute | make(callable|null $get = null, callable|null $set = null)
Create a new attribute accessor / mutator. | |
| static Attribute | get(callable $get)
Create a new attribute accessor. | |
| static Attribute | set(callable $set)
Create a new attribute mutator. | |
| Attribute | withoutObjectCaching()
Disable object caching for the attribute. | |
| Attribute | shouldCache()
Enable caching for the attribute. |
Create a new attribute accessor / mutator.
Create a new attribute accessor / mutator.
Create a new attribute accessor.
Create a new attribute mutator.
Disable object caching for the attribute.
Enable caching for the attribute.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Database/Eloquent/Casts/Attribute.html