PHPackages                             mill-hill-automation/laravel-model-watch - 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. [Database &amp; ORM](/categories/database)
4. /
5. mill-hill-automation/laravel-model-watch

ActiveLibrary[Database &amp; ORM](/categories/database)

mill-hill-automation/laravel-model-watch
========================================

Adds a model:watch command to poll the database for changes to Eloquent models

1.0.1(2y ago)01.0k1[4 PRs](https://github.com/mill-hill-automation/laravel-model-watch/pulls)MITPHPPHP ^8.0

Since Nov 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mill-hill-automation/laravel-model-watch)[ Packagist](https://packagist.org/packages/mill-hill-automation/laravel-model-watch)[ Docs](https://github.com/mill-hill-automation/laravel-model-watch)[ RSS](/packages/mill-hill-automation-laravel-model-watch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (7)Used By (0)

Adds a model:watch command to poll the database for changes to Eloquent models
==============================================================================

[](#adds-a-modelwatch-command-to-poll-the-database-for-changes-to-eloquent-models)

[![Latest Version on Packagist](https://camo.githubusercontent.com/17eb36035a70a87f34e96e00cc9f3c3dce19fda20bebbb9c4edac8ed8e64a213/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696c6c2d68696c6c2d6175746f6d6174696f6e2f6c61726176656c2d6d6f64656c2d77617463682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mill-hill-automation/laravel-model-watch)[![GitHub Tests Action Status](https://camo.githubusercontent.com/2674ee7009fcdd9387bc89ec4df541ad9970cf64cb4386c0891da420d34021b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d696c6c2d68696c6c2d6175746f6d6174696f6e2f6c61726176656c2d6d6f64656c2d77617463682f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/mill-hill-automation/laravel-model-watch/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6fa231f24074dbeacf9f95c042969b3890b02d26f98cd047b0edd9a22eac35f1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d696c6c2d68696c6c2d6175746f6d6174696f6e2f6c61726176656c2d6d6f64656c2d77617463682f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/mill-hill-automation/laravel-model-watch/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f99247666f91cf0e39ba51ee667cdd84e59b1bb06004115fb813f2b9e7bd23ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696c6c2d68696c6c2d6175746f6d6174696f6e2f6c61726176656c2d6d6f64656c2d77617463682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mill-hill-automation/laravel-model-watch)

Adds a `artisan model:watch` command to watch for changes to Eloquent models by polling the database.

Use Case &amp; Demo
===================

[](#use-case--demo)

I created this package as part of reverse engineering a closed course system, using a Laravel project with models setup to read a from the target database, it allowed me to figure out what the system was doing when (for example) allocating payments to invoices.

[![laravel-model-watch-demo](resources/images/laravel-model-watch-demo.gif)](resources/images/laravel-model-watch-demo.gif)

The [ModelWatchCollection](#watch-dynamic-or-multiple-models) used above is as simple as this:

```
