K
K
Kay42020-07-31 13:51:09
Laravel
Kay4, 2020-07-31 13:51:09

Why is Laravel Eloquent not updating the sum property on the model?

I get the model:
$order = Order::find(1);

In this model, you need to update status and sum
$order->status = "check";
$order->sum = 100;
$order->save();

As a result, the status is updated, but the amount is not, why? And if you give the model to the page, sum also comes without changes.

PS: it's probably the name sum, but changing it will be quite expensive

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question