From 9dc06ae8039316b1216ed7931f3a43a89382f9d0 Mon Sep 17 00:00:00 2001 From: Julian Hundeloh <5358638+jaulz@users.noreply.github.com> Date: Fri, 24 May 2024 19:28:24 +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 a3f7bc3..f24bb8d 100644 --- a/src/JobPipeline.php +++ b/src/JobPipeline.php @@ -60,12 +60,12 @@ class JobPipeline implements ShouldQueue public function handle(): void { foreach ($this->jobs as $job) { - if (is_string($job)) { + if (is_string($job) && 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]);