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