alexa

How to perform action globally when record get updated in laravel ?

How to perform action globally when record get updated in laravel ?

When you do this:

Model::where('status',1)->update([some stuff]);

Query Builder's update() method is executed instead of Eloquent's update() method.

If you want to trigger Eloquent events, you need to update rows one by one. You can fire these events manually, but it's tricky and it's a bad idea.

You could just run the UpdateRateZone job manually for all the Consignments that were updated


196 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online

Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry