iteearmah / laravel-remote-jobs
HTTP endpoints that let a Node.js worker claim and execute Laravel queued jobs from the standard jobs table.
v1.0.0
2026-08-31 00:00 UTC
Requires
- php: ^8.1
- illuminate/queue: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
HTTP endpoints that let a Node.js worker claim and execute Laravel queued jobs
from the standard jobs table (the database queue connection). No custom queue
driver is needed — the package is the backend for the
laravel-jobs-runner Node.js worker.
Installation
composer require iteearmah/laravel-remote-jobs
The service provider is auto-discovered. Publish the config (optional):
php artisan vendor:publish --tag=remote-jobs-config
Configuration
Set these in the consuming app's .env:
| Variable | Default | Description |
|---|---|---|
REMOTE_WORKER_TOKEN |
— | Shared secret the worker must present |
REMOTE_RETRY_AFTER |
90 |
Seconds before a reserved job is considered stale |
REMOTE_MAX_TRIES |
3 |
Default max attempts before a job is failed |
REMOTE_BACKOFF |
10 |
Default backoff (seconds) between retries |
Endpoints
All under /api/remote-jobs, authenticated with the X-Remote-Worker-Token header:
POST /next— atomically claims the next pending job (setsreserved_at, incrementsattempts).POST /execute— runs the job'shandle()via the Bus dispatcher; deletes the row on success, retries with backoff, or moves the job tofailed_jobswhen attempts run out.POST /release— returns a claimed job to the queue (worker timeout path).
Requirements
- The app must have the standard
jobsandfailed_jobstables (default Laravel migrations). - Dispatch jobs with
->onConnection('database')(or setQUEUE_CONNECTION=database). - Do not run
php artisan queue:work— the Node.js worker is the only consumer.
Testing
php artisan remote-job:test
Dispatches a TestJob to the database queue so you can watch the Node.js worker process it.