What is the best way to check if updated resource attributes have changed in afterSave hook?
I am currently doing this, but it seems inefficient and too verbose:
2 Replies
what about
wasChanged
? Maybe this can help you..
https://laravel.com/docs/11.x/eloquent#examining-attribute-changesLaravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Ahh! I only tried
isDirty
, will try with wasChanged
!