protected function handle() { if ($this->request->isAjax()) { return JsonResponse::notFound(); } return Response::notFound(); }
public function post() { if (!$this->validTwilioRequest()) { return Response::forbidden('Invalid Signature'); } $template = $this->getTemplate('twiml/no-call'); return TwimlResponse::ok($template); }
/** * @return Response */ public function options() { $response = Response::ok(); $response->setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); $response->setHeader('Access-Control-Max-Age', '604800'); $response->setHeader('Access-Control-Allow-Headers', 'authorization, x-requested-with, x-requested-by'); return $response; }
public function post() { try { if (!$this->security->checkToken()) { throw new Exception('Something went wrong. Please try again.'); } $this->setColor($this->request->getPost('color', 'alphanum')); } catch (Exception $e) { $this->flash->error($e->getMessage()); } return Response::temporaryRedirect(array('for' => 'home')); }
public function post() { try { if (!$this->validTwilioRequest()) { return Response::forbidden('Invalid Signature'); } $color = strtolower(trim($this->request->getPost('Body'))); $this->setColor($color); $template = $this->getTemplate('twiml/thanks'); return TwimlResponse::ok($template); } catch (Exception $e) { $template = $this->getTemplate('twiml/bad-color'); return TwimlResponse::ok($template); } }
public function delete() { return $this->request->isAjax() ? JsonResponse::methodNotAllowed() : Response::methodNotAllowed(); }