php - Laravel: Addition to an existing field data in a column -
please how express php mysql update code in eloquent
mysql_query("update `some_table` set `value` = `value` + 1000 `id` = 1");
or
mysql_query("update `some_table` set `value` = `value` + $formdata `id` = 1");
you can retrieve model , increment it:
$model = some_model::find( $id ); $model->value += 1000; $model->save();
Comments
Post a Comment