Detect changes when saving Laravel 4: Eloquent

前端 未结 2 816
醉酒成梦
醉酒成梦 2021-02-07 13:33

I\'m using the Laravel 4 framework and I am trying to work out a way to display notifications depending on whether a save() was successful or not. Here\'s what I ha

2条回答
  •  忘掉有多难
    2021-02-07 14:19

    You can take a look at the getDirty() method in the Eloquent model (model.php). This method should return the changed attributes.

提交回复
热议问题