From 524f05e749002b9865bb667e5f56ef7180adc9d1 Mon Sep 17 00:00:00 2001 From: Julian Hundeloh <5358638+jaulz@users.noreply.github.com> Date: Fri, 24 May 2024 19:14:22 +0200 Subject: [PATCH] feat: allow custom method names --- src/JobPipeline.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JobPipeline.php b/src/JobPipeline.php index 2781ef0..27e61e3 100644 --- a/src/JobPipeline.php +++ b/src/JobPipeline.php @@ -65,12 +65,12 @@ class JobPipeline implements ShouldQueue public function handle(): void { foreach ($this->jobs as $job) { - if (is_string($job)) { + if (class_exists($job)) { $job = [new $job(...$this->passable), 'handle']; } try { - $result = app()->call($job); + $result = app()->call($job, $this->passable); } catch (Throwable $exception) { if (method_exists(get_class($job[0]), 'failed')) { call_user_func_array([$job[0], 'failed'], [$exception]);