예제 #1
0
 /**
  * returns lookingfor data for a particular user profile.
  *
  * @param object        $request
  *
  *
  * @return json
  */
 public function getLookingFor(Request $request)
 {
     $username = $request->username;
     try {
         $userID = User::where('username', $username)->get()[0]->id;
         $lookingForData = LookingFor::where('user_id', $userID)->get();
         return response()->json(['status' => 200, 'data' => $lookingForData], 200);
     } catch (QueryException $e) {
         return response()->json(['status' => 200, 'done' => false], 200);
     }
 }
예제 #2
0
 private function userPreferences($userId)
 {
     $lookingForData = LookingFor::where('user_id', $userId)->get();
     return $lookingForData;
 }