โ˜… A package to watch for file system changes in PHP

1 ยท Freek Van der Herten ยท May 12, 2021, 7:28 a.m.
Our team has released a new package called file-system-watcher. As the name implies, this package can watch changes in the file system and let you act on those changes.Using the package #Here's a simple example that allows you to run some code when a new file gets added.use Spatie\Watcher\Watch; Watch::path($directory) ->onFileCreated(function (string $newFilePath) { // do something... }) ->start(); After calling start, the watcher will start a never-ending loop. When a file is created in the gi...