Пример #1
0
 /**
  * Validate the request using the checkable class.
  *
  * @throws FailedCheckException
  */
 public function validate()
 {
     if ($this->container->bound('illuminated.skipCheckableRequest')) {
         return;
     }
     $check = $this->getCheckable();
     $result = $check->check($this->assemble($this->request));
     if ($result->failed()) {
         $this->handleFailure($check, $result);
     }
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $correlationalId = $request->attributes->get(CorrelationalId::HEADER);
     if ($this->application->bound('sentry')) {
         /** @var Raven_Client $sentry */
         $sentry = $this->application->make('sentry');
         $sentry->tags_context([self::TAG_NAME => $correlationalId]);
     }
     /** @var Response $response */
     $response = $next($request);
     return $response;
 }
Пример #3
0
 /**
  * Send the given request through the middleware / router.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 protected function sendRequestThroughRouter($request)
 {
     $this->app->instance('request', $request);
     Facade::clearResolvedInstance('request');
     $this->bootstrap();
     $shouldSkipMiddleware = $this->app->bound('middleware.disable') && $this->app->make('middleware.disable') === true;
     return (new Pipeline($this->app))->send($request)->through($shouldSkipMiddleware ? [] : $this->middleware)->then($this->dispatchToRouter());
 }