diff --git a/src/Laritor.php b/src/Laritor.php index 3f057b4..32314bb 100644 --- a/src/Laritor.php +++ b/src/Laritor.php @@ -23,7 +23,7 @@ class Laritor { - public const VERSION = '4.0.1'; + public const VERSION = '4.0.2'; /** * @var array diff --git a/src/Recorders/QueryRecorder.php b/src/Recorders/QueryRecorder.php index 346b630..424273a 100644 --- a/src/Recorders/QueryRecorder.php +++ b/src/Recorders/QueryRecorder.php @@ -59,6 +59,10 @@ protected function formatBindings($event) */ public function replaceBindings($event) { + if (method_exists($event, 'toRawSql')) { + return $event->toRawSql(); + } + $sql = $event->sql; foreach ($this->formatBindings($event) as $key => $binding) { diff --git a/src/Recorders/QueuedJobRecorder.php b/src/Recorders/QueuedJobRecorder.php index 8cc4b94..6cb65ca 100644 --- a/src/Recorders/QueuedJobRecorder.php +++ b/src/Recorders/QueuedJobRecorder.php @@ -108,11 +108,12 @@ public function processing(JobProcessing $event) if ($event->connectionName === 'sync') { $job['queued_at'] = now()->toDateTimeString(); $job['delay'] = 0; - $job['context'] = $this->laritor->getContext(); } else { $this->laritor->setContext('JOB'); } + $job['context'] = $this->laritor->getContext(); + $this->laritor->pushEvent(static::$eventType, $job); } else { $this->laritor->setContext('JOB');