Eloquent’s fresh() and refresh() Are Not the Same
- Laravel
- Eloquent
refresh() reloads the model in-place from the database.
fresh() returns a new instance.
1$user->name = 'John';2$user->refresh(); // Will discard changes and reload3 4$newUser = $user->fresh(); // $user still has changes, $newUser doesn't
Subtle difference, big impact.