laravel one to many with pivot code example
Example: laravel many to many update all pivot
$user->customviews()
->newPivotStatement()
->where('user_id', '=', $user->id)
->update(array('default' => 0));
$user->customviews()
->newPivotStatement()
->where('user_id', '=', $user->id)
->update(array('default' => 0));