christopherpeacock/laravel-job-watcher

A PHP Laravel Job Watcher to auto-restart queue worker on job file changes.

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/christopherpeacock/laravel-job-watcher

dev-main 2025-06-13 09:01 UTC

This package is auto-updated.

Last update: 2025-10-13 09:36:37 UTC


README

Hot reload for Laravel Jobs — automatically restart your queue workers when job files change during development.

Problem

When working on Laravel Jobs, you often have to stop and restart the queue worker manually to see your code changes take effect. This repetitive process slows down development and wastes time.

Solution

Hot Reload for Laravel Jobs — inspired by JavaScript frameworks, this tool watches the app/Jobs directory and automatically restarts the Laravel queue worker whenever it detects PHP file changes. No more manual restarts; just code and watch your changes take effect immediately.

Installation

Install via composer:

composer require christopherpeacock/laravel-job-watcher

Usage

Run from your Laravel project root folder:

php vendor/christopherpeacock/laravel-job-watcher/bin/laravel-job-watcher.php

The watcher will:

  • Monitor the app/Jobs directory for any PHP file changes
  • Automatically restart the Laravel queue worker upon detecting changes
  • Print clear status messages to keep you informed
  • Keep your development workflow smooth and uninterrupted

Example Output

$ vendor/bin/laravel-job-watcher

Requirements

  • PHP 8.0 or higher
  • Laravel 9.0 or higher

How It Works

The job watcher uses file system events to monitor changes in your job files. When a change is detected:

  1. The current queue worker process is gracefully terminated
  2. A new queue worker is started automatically
  3. Your updated job code is now active without manual intervention

Development Benefits

  • Faster Development: No more manual queue worker restarts
  • Improved Workflow: Focus on coding, not process management
  • Real-time Testing: See your job changes immediately
  • Error Prevention: Avoid forgetting to restart workers

Credits