mirror of
https://github.com/archtechx/jobpipeline.git
synced 2025-12-12 18:44:04 +00:00
feat: allow custom method names
This commit is contained in:
parent
36474ffd21
commit
9dc06ae803
1 changed files with 2 additions and 2 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue