laravel 如何在不再次调用模型的情况下获取更新的字段

How to get updated field without calling the model again in laravel

我只是想知道有没有一种方法可以在不再次调用模型的情况下获取更新的记录?

例如

$point = 5;
$user = User::find(1);
$user->increment('point', $point); //

echo $user->point; // I get 0 from this

但如果我再次调用模型

$user = User::find(1);

return $user->point; // I get 5 from this

之前谢谢你。

Eloquent 模型有一个 refresh 方法:

$point = 5;
$user = User::find(1);
$user->increment('point', $point);

return $user->refresh()->point;