class Illuminate / Database / Eloquent / Casts / Attribute

Attribute

Properties

public

$get callable

The attribute accessor.

Default: null
public

$set callable

The attribute mutator.

Default: null
public

$withCaching bool

Indicates if caching is enabled for this attribute.

Default: false
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

make ( callable $get , callable $set ) : static

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.

public

shouldCache ( ) : static

Enable caching for the attribute.