public function account() { if (Auth::User()) { $user_data = Auth::User(); } $requests = array(); $user = new user(); $image = new image(); $feature_img = $image->get_feature_image(); $friend = new friend(); $friend_request = $friend->show_friend_request(); if (is_array($friend_request) && count($friend_request) >= 1) { foreach ($friend_request as $request) { $requests[] = $user->get_user($request->user_id); } } $get_friends = $friend->get_friends(); foreach ($get_friends as $get_all_friend) { $all_friends[] = $user->get_user($get_all_friend->friend_id); } if (isset($all_friends) && count($all_friends) != 0) { return view('account')->with(array('image' => $feature_img, 'requests' => $requests, 'user_data' => $user_data, 'all_friends' => $all_friends)); } else { return view('account')->with(array('image' => $feature_img, 'requests' => $requests, 'user_data' => $user_data)); } }
public function confirm_friend_request($id) { $friend = new friend(); $friend->confirm_friend_request($id); return Redirect('account'); }
public function city() { $friends = friend::where('City', '=', $_GET['city_name'])->get(); return view('index', ['friends' => $friends]); }
public function friends() { $friends = friend::where('OwnerId', '=', $_GET['page_id'])->get(); return view('pages.friend', ['friends' => $friends]); }