Example #1
0
 /**
  * Merge the group stack with the controller action.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return void
  */
 protected function mergeGroupAttributesIntoRoute($route)
 {
     $action = $this->mergeWithLastGroup($route->getAction());
     $route->setAction($action);
 }
Example #2
0
 /**
  * Add a new route to an API collection.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return \Illuminate\Routing\Route
  */
 protected function addApiRoute($route)
 {
     // Since the groups action gets merged with the routes we need to make
     // sure that if the route supplied its own protection that we grab
     // that protection status from the array after the merge.
     $action = $route->getAction();
     if (count($this->groupStack) > 0 and isset($action['protected'])) {
         $action['protected'] = is_array($action['protected']) ? last($action['protected']) : $action['protected'];
         $route->setAction($action);
     }
     $versions = array_get(last($this->groupStack), 'version', []);
     foreach ($versions as $version) {
         if ($collection = $this->getApiRouteCollection($version)) {
             $collection->add($route);
         }
     }
     return $route;
 }
 /**
  * Merge the group stack with the controller action.
  *
  * @param  \Illuminate\Routing\Route  $route
  * @return void
  */
 protected function mergeController($route)
 {
     $action = $this->mergeWithLastGroup($route->getAction());
     $route->setAction($action);
 }
Example #4
0
 /**
  * {@inheritDoc}
  */
 public function setAction(array $action)
 {
     $action = static::parseAction($action);
     return parent::setAction($action);
 }