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
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 16
__construct(array $options = [])

Create a new watcher instance.

Parameters

array $options

the configured watcher options

at line 25
void register(Application $app)

Register the watcher.

Parameters

Application $app

Return Value

void

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

Set the watcher options.

Parameters

array $options

Return Value

Watcher

at line 41
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 81
array getHydrations()

Get all hydration entries.

Return Value

array

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

Get a hydration entry for the given model class.

Parameters

string $modelClass

Return Value

IncomingEntry|null

at line 97
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 110
void recordHydrations(Model $data)

Record model hydrations.

Parameters

Model $data

Return Value

void

at line 142
void flushHydrations()

Flush the cached entries.

Return Value

void