Search code examples
phpformslaravellaravel-5

How to know which fields were updated


I'm working in laravel 5, I have a module where the user can update the information of students, for that The user has a preloaded form with the current data and he can modify the fields that he wants.Then, in the controller I do:

$perfil->update(Input::all())

That works pretty good. So my question is: there's a way of get the name of the fields that have been updated?


Solution

  • You want to use the dirty() method. this has been explained well here.

    Laravel Eloquent update just if changes have been made