Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SupianIDz committed May 16, 2021
1 parent deb0a51 commit 9a1c69e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,28 @@ $ artisan vendor:publish --provider="Octopy\Inotify\InotifyServiceProvider"

## Usage

See [WIKI](https://github.com/OctopyID/LaraInotify/wiki) for details.
See [WIKI](https://github.com/OctopyID/LaraInotify/wiki) for more details.

```php
use Octopy\Inotify\Inotify;
use Octopy\Inotify\Event\InotifyEvent;
use Octopy\Inotify\Watcher\InotifyWatcher;
use Octopy\Inotify\Contract\Event;
use Octopy\Inotify\Contract\Watcher;

$inotify = new Inotify('foo.txt');

$inotify->event(function (InotifyEvent $event) {
$inotify->event(function (Event $event) {

$event->on(IN_MODIFY, function (InotifyWatcher $watcher) {
$event->on(IN_MODIFY, function (Watcher $watcher) {
// do something
});

$event->on(IN_DELETE, function (InotifyWatcher $watcher) {
$event->on(IN_DELETE, function (Watcher $watcher) {
// do something
});

// see : https://www.php.net/manual/en/inotify.constants.php for more events.
});


$inotify->watch();
```

Expand Down

0 comments on commit 9a1c69e

Please sign in to comment.