protected function handle()
 {
     if ($this->request->isAjax()) {
         return JsonResponse::notFound();
     }
     return Response::notFound();
 }
示例#2
0
 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;
 }
示例#4
0
 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);
     }
 }
示例#6
0
 public function delete()
 {
     return $this->request->isAjax() ? JsonResponse::methodNotAllowed() : Response::methodNotAllowed();
 }