class ModelWatcher extends Watcher

Constants

HYDRATIONS_CONTEXT_KEY

Methods

__construct(array $options = [])

Create a new watcher instance.

from  Watcher
void
register(Application $app)

Register the watcher.

setOptions(array $options)

Set the watcher options.

from  Watcher
array
hideParameters(array $data, array $hidden)

Hide the given parameters.

from  Watcher
void
recordAction(string $event, array $data)

Record an action.

array
getHydrations()

Get all hydration entries.

getHydration(string $modelClass)

Get a hydration entry for the given model class.

void
updateHydration(string $modelClass, IncomingEntry $entry)

Update the hydration entry for the given model class.

void
recordHydrations(Model $data)

Record model hydrations.

void
flushHydrations()

Flush the cached entries.

Details

in Watcher at line 18
__construct(array $options = [])

Create a new watcher instance.

Parameters

array $options

the configured watcher options

at line 26
void register(Application $app)

Register the watcher.

Parameters

Application $app

Return Value

void

in Watcher at line 31
Watcher setOptions(array $options)

Set the watcher options.

Parameters

array $options

Return Value

Watcher

in Watcher at line 41
protected array hideParameters(array $data, array $hidden)

Hide the given parameters.

Parameters

array $data
array $hidden

Return Value

array

at line 42
void recordAction(string $event, array $data)

Record an action.

Parameters

string $event

The event name (e.g., "eloquent.created: App\Models\User")

array $data

The wildcard listener payload

Return Value

void

at line 82
array getHydrations()

Get all hydration entries.

Return Value

array

at line 90
IncomingEntry|null getHydration(string $modelClass)

Get a hydration entry for the given model class.

Parameters

string $modelClass

Return Value

IncomingEntry|null

at line 98
void updateHydration(string $modelClass, IncomingEntry $entry)

Update the hydration entry for the given model class.

Parameters

string $modelClass
IncomingEntry $entry

Return Value

void

at line 111
void recordHydrations(Model $data)

Record model hydrations.

Parameters

Model $data

Return Value

void

at line 143
void flushHydrations()

Flush the cached entries.

Return Value

void