Exemplo n.º 1
0
 protected function handle()
 {
     if ($this->request->isAjax()) {
         return JsonResponse::notFound();
     }
     return Response::notFound();
 }
Exemplo n.º 2
0
 public function post()
 {
     if (!$this->validTwilioRequest()) {
         return Response::forbidden('Invalid Signature');
     }
     $template = $this->getTemplate('twiml/no-call');
     return TwimlResponse::ok($template);
 }
Exemplo n.º 3
0
 /**
  * @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;
 }
Exemplo n.º 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'));
 }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
 public function delete()
 {
     return $this->request->isAjax() ? JsonResponse::methodNotAllowed() : Response::methodNotAllowed();
 }