PHPackages                             hackeresq/laravel-watcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. hackeresq/laravel-watcher

ActiveLibrary

hackeresq/laravel-watcher
=========================

Watch for specific keys in your Laravel form requests and perform specific functions

v1.0.1(5y ago)126MITPHPPHP &gt;=7.0

Since Feb 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hackeresq/laravel-watcher)[ Packagist](https://packagist.org/packages/hackeresq/laravel-watcher)[ RSS](/packages/hackeresq-laravel-watcher/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

laravel-watcher
===============

[](#laravel-watcher)

[![Latest Version on Packagist](https://camo.githubusercontent.com/52b751f1e31a6ab503b777be0155627669187c483fbcb2bbcd7fd142a9eb6e2d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6861636b65724553512f6c61726176656c2d776174636865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hackerESQ/laravel-watcher)[![Total Downloads](https://camo.githubusercontent.com/45a1d604de3374140d7ab58b9b05b7b1b6054bb9a1d592eb4ddcf791e5b6ce4c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6861636b65724553512f6c61726176656c2d776174636865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hackerESQ/laravel-watcher)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Set a watcher to watch for specific keys in your Laravel form requests. If those keys are present, perform any arbitrary functions(s).

- [Installation](#installation)
- [Usage](#usage)
- [Complete Example](#complete-example)

Installation
------------

[](#installation)

This package can be used in Laravel 5.4 or higher.

You can install the package via composer:

```
composer require hackeresq/laravel-watcher
```

Watcher is a trait that can be added to your Laravel FormRequests (or you can use the included base FormRequest). To start using the `setWatcher()` method, you must 'use' the Watcher trait by either adding it to your FormRequest or using the base [WatcherRequest](https://github.com/hackerESQ/laravel-watcher/blob/master/src/Requests/WatcherRequest.php) in your controllers.

An example of a custom FormRequest implementation:

```
