Пример #1
0
 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;
 }
Пример #2
0
 public function ifUserExists($userId)
 {
     return User::where("id", "=", $userId)->count() > 0;
 }
Пример #3
0
 public function getAllByUser(User $user)
 {
     return $user->favourites()->getResults()->load("profile");
 }
Пример #4
0
 public function haveMissingUser($userIds)
 {
     return User::whereIn("id", $userIds)->count() <= 0;
 }