Exemplo n.º 1
0
 /**
  * register the provider
  *
  * @return mixed
  */
 public function register()
 {
     App::bind('route.not.found', function () {
         App::abort(404, 'Page Not Found');
     });
     App::bind('route.middleware.failed', function () {
         throw new MiddlewareException('You can\'t access here, your authority is incorrect');
     });
 }
Exemplo n.º 2
0
 /**
  * throw an http exception with given datas
  *
  * @param int $code
  * @param string $message
  * @param array $headers
  * @throws HttpException
  */
 function abort($code = 503, $message = '', array $headers = [])
 {
     App::abort($code, $message, $headers);
 }