Updating the Relation Model

Submitted by monaye - 9 years ago

There is easy way to update relation model without query for related model.

$shop = Shop::find(1); 

// update shop info 
$shop->fill(['name'=>'product 1']); 
$shop->save(); 

// Update relation model 
$shop->shiping()->update(['normal'=>'1000']);