I'm using Laravel 5 and would like to know if after modifying an attribute of a model, you can retrieve it.
For example:
$usuario = Usuario::where(['nome' => 'Wallace'])->first();
$usuario->nome = 'Guilherme';
In the example above, I modified the nome
attribute of the model. I would like to know if you can retrieve the nome
attribute. Does Laravel "save" the original value somewhere before saving changes?
Of course I could do this by doing another query, but I do not think that is the best way. So I will not accept answers of the type.
I would like to know if there is any way to retrieve the initial value of the "name" attribute of the above model without doing another query.