예제 #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;
 }