- How do I install yosymfony/resource-watcher in a Laravel app?
- Install it with Composer using composer require yosymfony/resource-watcher. It does not ship a Laravel service provider, facade, or config file, so you will typically wrap it in an Artisan command or a small adapter class. Keep the dependency isolated from request and response code and pin a tested version.
- Is yosymfony/resource-watcher compatible with Laravel 10 and Laravel 11?
- There is no Laravel-native integration, and the package depends on Symfony Finder and Symfony EventDispatcher, so compatibility depends on the Symfony component versions allowed by your Laravel release. The last release was in 2020, so Laravel 10 or 11 support must be proven with composer why-not and a short compatibility spike. Do not assume it installs cleanly under Symfony 6 or 7 without testing.
- How does yosymfony/resource-watcher detect file changes?
- It uses pluggable detection strategies, including inotify on supported systems and a portable checksum and polling approach. The ResourceWatcher API emits events for created, updated, and deleted resources. You can watch directories recursively, with optional Symfony Finder filtering.
- Can I filter watched files with Symfony Finder in yosymfony/resource-watcher?
- Yes. The library supports recursive directory watching with optional Symfony Finder filtering, so you can exclude vendor directories, logs, or build artifacts. This is useful in Laravel projects with large trees. Validate your ignore rules and cache location to avoid unnecessary CPU and I/O.
- How do I map yosymfony/resource-watcher events to Laravel events?
- The package uses Symfony EventDispatcher events rather than Laravel events, so you need a thin adapter. In that adapter, listen for the Symfony created, updated, and deleted events and dispatch your own Laravel events or callbacks. Keep application code depending on your Laravel-facing interface, not the Symfony event classes.
- What cache backend does yosymfony/resource-watcher use for file hashes?
- The supplied context does not name a specific cache backend, but the checksum and polling strategy relies on stored resource hashes. You must confirm the cache location, directory permissions, and invalidation behavior in your environment. In containers, ensure the cache path is writable and not unexpectedly ephemeral.
- Can yosymfony/resource-watcher run continuously under Supervisor or systemd?
- It is a CLI-oriented, long-running library, so it can be run as an Artisan command or sidecar process under Supervisor or systemd. However, polling and checksum strategies can consume CPU and I/O on large directory trees. Define restart behavior, logging, memory limits, and polling intervals before using it continuously.
- What are alternatives to yosymfony/resource-watcher for Laravel file watching?
- Alternatives include Vite or webpack watchers for frontend reloads, Node chokidar, inotify-based shell scripts, cron jobs, or custom Laravel commands. The right choice depends on whether you need cross-platform polling, low-latency inotify, or integration with an existing build tool. Compare accuracy, CPU usage, and maintenance burden before replacing an existing watcher.
- Does yosymfony/resource-watcher work on Windows, Docker, and network filesystems?
- Inotify is primarily a Linux mechanism, while the checksum and polling strategy is more portable but behaves differently across filesystems. Atomic writes, temporary files, symlinks, deletion handling, and cache permissions can vary in Docker, Windows, and network-mounted directories. Test on the actual developer and CI operating systems before relying on it.
- Is yosymfony/resource-watcher maintained and safe for production Laravel apps?
- The last release was in 2020, stars are low, and the repository is unknown in the supplied metadata, which creates maintenance and supply-chain traceability concerns. Treat it as an internal productivity or proof-of-concept dependency, not a production-critical platform component. Pin the version, isolate it behind an interface, and have a fork, vendor, or replacement plan.