jpkleemans / attribute-events

🔥 Fire events on attribute changes of your Eloquent model
https://attribute.events
MIT License
309 stars 20 forks source link

JSON-columns #2

Closed jeffreyvanhees closed 3 years ago

jeffreyvanhees commented 3 years ago

Hi! Great package and well documented, thanks a lot!

Question: Do you have an idea how to dispatch an event when a value in a json-column changes? Like:

protected $dispatchesEvents = [
  'settings->color:*' => ColourChanged::class,
]

The example above doesn't seems to work.

Jeffrey

jpkleemans commented 3 years ago

Hi Jeffrey, great suggestion! I've added support for it in version 1.1.0.

You can find the documentation here: https://github.com/jpkleemans/attribute-events#json-attributes

jeffreyvanhees commented 3 years ago

Your're great! Thanks a lot!