diff 方法返回不在给定集合中的所有模型:
diff
use App\Models\User; $users = $users->diff(User::whereIn('id', [1, 2, 3])->get());Copy
use App\Models\User; $users = $users->diff(User::whereIn('id', [1, 2, 3])->get());
关闭