Supervise: Define Laravel Worker Configs in PHP, Not INI Files

Every Laravel application that runs queue workers, schedulers, or background processes needs Supervisor. And every team has the same pain: hand-editing .ini files on servers, keeping them in sync across environments, and debugging configuration drift.

Supervise fixes this by letting you define Supervisor configurations in PHP — version-controlled, deployable, and consistent.

The Problem with INI Files

Supervisor is excellent at what it does. But its configuration format is stuck in the past:

  • Not version-controlled — INI files live on servers, not in your repo
  • Environment-specific — Different paths, users, and process counts per environment
  • Error-prone — One typo in an INI file and your workers silently fail
  • Manual deployment — SSH into every server, edit files, reload Supervisor

PHP-Based Configuration

With Supervise, your worker configuration lives in config/supervise.php:

// config/supervise.php
return [
    'workers' => [
        'queue-default' => [
            'command' => 'php artisan queue:work --queue=default',
            'numprocs' => 3,
            'autostart' => true,
            'autorestart' => true,
            'startsecs' => 1,
        ],
        'queue-high' => [
            'command' => 'php artisan queue:work --queue=high',
            'numprocs' => 2,
        ],
        'scheduler' => [
            'command' => 'php artisan schedule:work',
            'numprocs' => 1,
        ],
    ],
];

One-Command Deployment

php artisan supervise:deploy

This single command:

  1. Reads your PHP configuration
  2. Compiles it into valid Supervisor INI format
  3. Writes the configuration file
  4. Reloads Supervisor to pick up changes

No SSH. No manual editing. No configuration drift.

Process Grouping

Organize related workers into logical groups:

'groups' => [
    'payments' => ['queue-payments', 'webhook-processor'],
    'notifications' => ['queue-emails', 'queue-push'],
],

Then manage entire groups at once:

php artisan supervise:restart payments
php artisan supervise:status notifications

Environment-Aware

Use standard Laravel environment variables for per-environment tuning:

'queue-default' => [
    'command' => 'php artisan queue:work',
    'numprocs' => env('QUEUE_WORKERS', 3),
    'user' => env('SUPERVISOR_USER', 'forge'),
],

Development gets 1 worker. Production gets 8. Same config file.

Laravel 10, 11, and 12

Supervise supports the three most recent Laravel major versions. It works with any process that Supervisor can manage — not just queue workers.

Get started on GitHub.

View on GitHubStar the repo, explore the source code, and get started.
Go to Repository
Share this post
Back to Blog