public static function getStatus($desperate, $cool) { $temp1 = Access::where('desperate', '=', $desperate, 'and', 'cool', '=', $cool)->first(); $temp2 = Access::where('desperate', '=', $cool, 'and', 'cool', '=', $desperate)->first(); if ($temp1 && $temp2) { return true; } else { return false; } }
public function getAccess($id, Request $request, Response $response) { //save access request $accessRequest = Access::where('desperate', $request->cookie('shy_first_id'))->where('cool', $id)->first(); if (!is_object($accessRequest)) { $accessReq = new Access(); $accessReq->desperate = $request->cookie('shy_first_id'); $accessReq->cool = $id; $accessReq->save(); } else { return 'false'; } if (Access::getStatus($request->cookie('shy_first_id'), $id)) { Notifications::notify($id, $request->cookie('shy_first_id')); return 'true'; } }