Determine which fields have been changed before/after saving the model Author: Chuwen Time: 2021-08-21 Classification: Other classifications ##Code example ```php $user = User::whereId(1); $user->email = 'i@nowtime.cc'; //Before submitting the update, obtain which fields have been modified $user->getDirty();// Return to ["email": "i @ nowtime. cc"] $user->save(); //After submitting the update, obtain which fields have been modified $user->getChanges();// Return to ["email": "i @ nowtime. cc"] ``` -'getDirty' called before updating -'getChanges' is called after updating label: PHP , Laravel , Laravel Model