public function haveMissingUser($userIds) { $userInModel = User::select("id")->whereIn("id", $userIds)->lists("id")->all(); foreach ($userIds as $userId) { if (!in_array($userId, $userInModel)) { return true; } } return false; }
public function ifUserExists($userId) { return User::where("id", "=", $userId)->count() > 0; }
public function getAllByUser(User $user) { return $user->favourites()->getResults()->load("profile"); }
public function haveMissingUser($userIds) { return User::whereIn("id", $userIds)->count() <= 0; }