From de8822bc2c1f6c8529c55a2005472d3898081c0f Mon Sep 17 00:00:00 2001 From: Neil Aldred Date: Thu, 16 Mar 2023 01:22:24 +0000 Subject: [PATCH 1/2] Update regex to match laravel 10 to the laravel8worker class --- src/Integrations/BindsWorker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Integrations/BindsWorker.php b/src/Integrations/BindsWorker.php index e3261d4..f257cb1 100644 --- a/src/Integrations/BindsWorker.php +++ b/src/Integrations/BindsWorker.php @@ -22,7 +22,7 @@ trait BindsWorker protected $workerImplementations = [ '5\.[345678]\.\d+' => Laravel53Worker::class, '[67]\.\d+\.\d+' => Laravel6Worker::class, - '[89]\.\d+\.\d+' => Laravel8Worker::class + '([89]|10)\.\d+\.\d+' => Laravel8Worker::class ]; /** From cbca1cc6d98ca0f9b1ede6ad60643cc268d993e9 Mon Sep 17 00:00:00 2001 From: Neil Aldred Date: Thu, 16 Mar 2023 01:24:25 +0000 Subject: [PATCH 2/2] Convert app version to int before confirming. Its currently doing a string comparison meaning "9.0.0" is greater than 6 but "10.0.0" is not as it begins with a 1. Converting to int changes "10.0.0" to 10 allowing it to pass the condition correctly --- src/Integrations/BindsWorker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Integrations/BindsWorker.php b/src/Integrations/BindsWorker.php index f257cb1..a2aa98d 100644 --- a/src/Integrations/BindsWorker.php +++ b/src/Integrations/BindsWorker.php @@ -44,7 +44,7 @@ protected function findWorkerClass($version) protected function bindWorker() { // If Laravel version is 6 or above then the worker bindings change. So we initiate it here - if ($this->app->version() >= 6) { + if ((int) $this->app->version() >= 6) { $this->app->singleton(Worker::class, function () { $isDownForMaintenance = function () { return $this->app->isDownForMaintenance();