spatie/phpunit-watcher
Automatically rerun PHPUnit tests whenever your code changes. Run phpunit-watcher watch to execute and re-execute tests on edits in app/src/tests. Supports passing through PHPUnit arguments (e.g. --filter) and works as a global tool or dev dependency.
Install globally via composer global require spatie/phpunit-watcher, then run phpunit-watcher watch in any project directory to start automatic test reruns. The watcher will automatically detect changes in app, src, and tests directories and re-run PHPUnit on file modifications. This is ideal for TDD workflows—make a code change and immediately see test results without manual command repetition.
phpunit-watcher watch --filter=FeatureTest for targeted test cycles..phpunit-watcher.yml in project root to define persistent settings like watched directories, PHPUnit binary path, timeout, and initial arguments (e.g., --stop-on-failure). This ensures consistent behavior across team members."test:watch": "phpunit-watcher watch < /dev/tty" to composer.json scripts, and disable timeouts with Composer\\Config::disableProcessTimeout for full interactivity.exclude in config to omit directories like vendor/node_modules, and always specify fileMask: '*.php' to avoid watching non-PHP files.--filter= after config is set to avoid surprises.notifications.failingTests: false to reduce noise during early development.hideManual: true in config to suppress repetitive keyboard instruction text after each test run..phpunit-watcher.yml → phpunit-watcher.yml → phpunit-watcher.yml.dist and searches parent directories—ensure no stale config in parent folders overrides your project settings.How can I help you explore Laravel packages today?