Example #1
0
 /**
  * Marshal a RouteResult representing a route failure.
  *
  * If the route failure is due to the HTTP method, passes the allowed
  * methods when creating the result.
  *
  * @return RouteResult
  */
 private function marshalFailedRoute()
 {
     $failedRoute = $this->router->getFailedRoute();
     if (!$failedRoute->failedMethod()) {
         return RouteResult::fromRouteFailure();
     }
     return RouteResult::fromRouteFailure($failedRoute->method);
 }
Example #2
0
 /**
  * Marshal a RouteResult representing a route failure.
  *
  * If the route failure is due to the HTTP method, passes the allowed
  * methods when creating the result.
  *
  * @param Request $request
  * @return RouteResult
  */
 private function marshalFailedRoute(Request $request)
 {
     $failedRoute = $this->router->getFailedRoute();
     if ($failedRoute->failedMethod()) {
         return RouteResult::fromRouteFailure($failedRoute->method);
     }
     // Check to see if the route regex matched; if so, and we have an entry
     // for the path, register a 405.
     list($path) = explode('^', $failedRoute->name);
     if (isset($failedRoute->failed) && $failedRoute->failed !== AuraRoute::FAILED_REGEX && array_key_exists($path, $this->routes)) {
         return RouteResult::fromRouteFailure($this->routes[$path]);
     }
     return RouteResult::fromRouteFailure();
 }