diff --git a/src/ProvisioningPlan.php b/src/ProvisioningPlan.php index 58067571..d97ab994 100644 --- a/src/ProvisioningPlan.php +++ b/src/ProvisioningPlan.php @@ -2,6 +2,7 @@ namespace Laravel\Horizon; +use Exception; use Illuminate\Support\Arr; use Illuminate\Support\Str; use Laravel\Horizon\Contracts\HorizonCommandQueue; @@ -177,6 +178,10 @@ protected function convert($supervisor, $options) return [Str::camel($key) => $value]; })->all(); + if (isset($options['minProcesses']) && $options['minProcesses'] === 0) { + throw new Exception("The value of [{$supervisor}.minProcesses] must be greater than 0."); + } + $options['parentId'] = getmypid(); return SupervisorOptions::fromArray(