Closed stevebauman closed 1 year ago
This PR implements the ability to retrieve changes on a model after an update has been performed.
This is really handy to be able to retrieve all of the changed attributes of a model, after an update:
use LdapRecord\Models\Entry; $model = Entry::find('cn=jdoe,dc=local,dc=com'); $model->mail = 'foo@email.com'; $model->save(); $model->wasChanged(); // true $model->wasChanged('mail'); // true $model->wasChanged('invalid'); // false $model->wasChanged(['mail', 'invalid']); // true $model->getChanges(); // ['mail' => ['foo@email.com']]
This PR implements the ability to retrieve changes on a model after an update has been performed.
This is really handy to be able to retrieve all of the changed attributes of a model, after an update: