server->id' => $serverId, 'service' => ResultService::Ookla, 'status' => ResultStatus::Waiting, 'scheduled' => $scheduled, 'dispatched_by' => $dispatchedBy, ]); SpeedtestWaiting::dispatch($result); Bus::batch([ [ new StartSpeedtestJob($result), new CheckForInternetConnectionJob($result), new SkipSpeedtestJob($result), new SelectSpeedtestServerJob($result), new RunSpeedtestJob($result), new BenchmarkSpeedtestJob($result), new CompleteSpeedtestJob($result), ], ])->catch(function (Batch $batch, ?Throwable $e) { Log::error(sprintf('Speedtest batch "%s" failed for an unknown reason.', $batch->id)); })->name('Ookla Speedtest')->dispatch(); return $result; } }