public function addFavourite() { $friend = getUserObject(Input::get('id')); return $friend->username; }
function checkFavourite($id) { $user1 = getUserObject($id); $user2 = Auth::user()->id; $check = Favourites::where('user_id', $user2)->where('friend_id', $user1)->first(); if ($check != null) { return true; } else { return false; } }
/** * returns current user object * @return object */ public static function getCurrentUser() { return getUserObject(); }