0

I have a problem, laravel eloquent not save the updated fields when i call save function there is my example :

    $user->solde = $user->solde + 2000;
    $user->save();

the solde field is a double type in database, eloquent not fire event on update solde.

Uwe Allner
  • 3,399
  • 9
  • 35
  • 49
nat
  • 41
  • 1

2 Answers2

2

Use strval():

$user->solde = strval($user->solde + 2000);
$user->save();
Joundill
  • 6,828
  • 12
  • 36
  • 50
SAKIB
  • 475
  • 5
  • 7
0

I solve the problem with changing php ini precision to 12.

nat
  • 41
  • 1