push()
method
April 4th ʼ21 4 years ago
push()
method$user = User::find(1);
$user->name = 'new name';
$user->team->name = $user->name.'\'s team';
// Instead of saving all relationships separately
❌ $user->save();
❌ $user->team->save();
// You can save all relationships in single line
✅ $user->push();