Ejemplo n.º 1
0
 /**
  * Return an error page, optionally with data/message
  *
  * @param  int           HTTP status code
  * @param  array|string  Data or message
  */
 public static function error($status = 500, $data = array())
 {
     is_string($data) && ($data = array('message' => $data));
     $data['error'] = true;
     if (Request::ajax() || Request::accepts('application/json')) {
         return parent::json($data, $status);
     }
     if ($status == 404) {
         return parent::error($status, $data);
     }
     return \Event::first('response.error', [$status, $data]);
 }
 /**
  * Magic Method to handle calls to undefined controller functions.
  */
 public function __call($method, $parameters)
 {
     return Response::error('404');
 }