class JobWatcher extends Watcher

Properties

protected array<int, class-string> $ignoredJobClasses

The list of ignored jobs classes.

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
string
hideQueryParameters(string $uri)

Hide query credentials without changing unrelated URL bytes.

from  Watcher
recordJob(string $connection, string|null $queue, array $payload)

Record a job being created.

void
recordProcessedJob(JobProcessed $event)

Record a queued job was processed.

void
recordFailedJob(JobFailed $event)

Record a queue job has failed.

array|null
facadeContext()

Get the current facade context for the job entry.

array
defaultJobData(string $connection, string|null $queue, array $payload, array $data)

Get the default entry data for the given job.

array
data(array $payload)

Extract the job "data" from the job payload.

array
tags(array $payload)

Extract the tags from the job payload.

void
updateBatch(array $payload)

Update the batch.

mixed
getCommand(array $data)

Get the command from the given payload.

string|null
getBatchId(array $data)

Get the batch ID from the given payload.

Details

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

Create a new watcher instance.

Parameters

array $options

the configured watcher options

at line 44
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

in Watcher at line 55
protected string hideQueryParameters(string $uri)

Hide query credentials without changing unrelated URL bytes.

Parameters

string $uri

Return Value

string

at line 59
IncomingEntry|null recordJob(string $connection, string|null $queue, array $payload)

Record a job being created.

Parameters

string $connection
string|null $queue
array $payload

Return Value

IncomingEntry|null

at line 94
void recordProcessedJob(JobProcessed $event)

Record a queued job was processed.

Parameters

JobProcessed $event

Return Value

void

at line 127
void recordFailedJob(JobFailed $event)

Record a queue job has failed.

Parameters

JobFailed $event

Return Value

void

at line 173
protected array|null facadeContext()

Get the current facade context for the job entry.

Returns both visible and hidden context since jobs receive both, and "hidden" only means hidden from log output, not from Telescope. Returns null when no context exists.

Return Value

array|null

at line 196
protected array defaultJobData(string $connection, string|null $queue, array $payload, array $data)

Get the default entry data for the given job.

Parameters

string $connection
string|null $queue
array $payload
array $data

Return Value

array

at line 211
protected array data(array $payload)

Extract the job "data" from the job payload.

Parameters

array $payload

Return Value

array

at line 228
protected array tags(array $payload)

Extract the tags from the job payload.

Parameters

array $payload

Return Value

array

at line 242
protected void updateBatch(array $payload)

Update the batch.

Parameters

array $payload

Return Value

void

at line 272
protected mixed getCommand(array $data)

Get the command from the given payload.

Parameters

array $data

Return Value

mixed

Exceptions

RuntimeException

at line 290
protected string|null getBatchId(array $data)

Get the batch ID from the given payload.

Parameters

array $data

Return Value

string|null

Exceptions

RuntimeException