PHP code example of harrisonratcliffe / laravel-queue-watch

1. Go to this page and download the library: Download harrisonratcliffe/laravel-queue-watch library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

harrisonratcliffe / laravel-queue-watch example snippets


return [
    // Relative paths resolve against base_path(). A path can point at a
    // single file (like .env) or a directory, which is walked recursively.
    'paths' => ['app', 'bootstrap', 'config', 'database', 'routes', 'resources/views', '.env'],

    // Directories that are never descended into while scanning.
    'ignore' => ['vendor', 'node_modules', 'storage', '.git', 'public/build'],

    // File extensions to watch.
    'extensions' => ['php'],

    // How often (ms) the watched paths are rescanned.
    'poll_interval' => 1000,

    // Changes within this many milliseconds of each other are coalesced
    // into a single restart, so a formatter or multi-file save doesn't
    // trigger a restart storm.
    'debounce' => 300,

    // Seconds to wait after SIGTERM before force-killing the worker.
    'restart_timeout' => 10,

    // Override the full command used to spawn the worker. Leave null to
    // derive it from the running PHP binary:
    // [PHP_BINARY, base_path('artisan'), 'queue:work'].
    // Useful under Sail, Herd, Homestead, or a custom PHP install.
    'worker_command' => null,
];
console
$ php artisan queue:watch

queue:watch started - watching 7 path(s), polling every 1000ms.
Change detected (app/Jobs/ProcessPodcast.php); restarting worker...
bash
php artisan vendor:publish --tag="queue-watch-config"
bash
php artisan queue:watch