Laravel Lire la valeur d'origine avant la mise à jour
$model->getOriginal('attribute')
Lucky Ladybird
$model->getOriginal('attribute')
User::updating(function($user)
{
if ($user->username != $user->getOriginal('username')) {
doSomething();
}
// If you need multiple attributes you may use:
// $originalAttributes = $user->getOriginal();
// $originalUsername = $originalAttributes['username'];
});