讨论数量:
$user->unsetRelation('groups');
$user->unsetRelation('posts');
// OR
$user->unsetRelations();
$user = User::with('orders')->find(1);
$user->setVisible(['id', 'name']);
// or
// $user->setHidden(['orders']);
return $user;
推荐文章: