3
I have a configuration table in my database that has the following fields: ["id", "texto", "textoOriginal"]
.
Initially the field values texto
are equal to the field textoOriginal
, but the user can at a given time change the value of the field texto
.
I need to create a method that the user can reset the original values of the parameters, so I need to run this query:
UPDATE parametros SET texto = textoOriginal
But I wanted to do it for the syntax of Query Builder, it turns out that the Laravel updates the field texto
with the string "textOriginal".
I’m doing like this:
$this->update(['texto' => 'parametros.textoOriginal']);
Does anyone know how to do that?
already tried to do a query before the update that takes the value of the textOriginal ai after Voce passes this value in update $this->update(['text'=>'$Row->textOriginal]); ?
– rafaelphp
But then it would be too heavy, I wanted to update everything at once. But I guess there’s no way.
– Euler01