amitmerchant1990 / amitmerchant-dot-com-comments

1 stars 0 forks source link

tracking-model-attribute-laravel/ #30

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Tracking model attribute changes in Laravel – Amit Merchant – A blog on PHP, JavaScript and more

Sometimes, it’s useful to know if somethig has been changed in the model since it’s been loaded. For instance, you would want to check if the is_published attribute of the Post model is set or not before publishing the post further.

https://www.amitmerchant.com/tracking-model-attribute-laravel/

alexstewartja commented 3 years ago

I recently published a package to save you from all the boilerplate of tracking/observing and reacting to model attribute changes.

Grab it here: alexstewartja/laravel-attribute-observer