/** * Add the route to any look-up tables if necessary. * * @param \Nova\Routing\Route $route * @return void */ protected function addLookups($route) { $action = $route->getAction(); if (isset($action['as'])) { $this->nameList[$action['as']] = $route; } if (isset($action['controller'])) { $this->addToActionList($action, $route); } }
/** * Add the route to any look-up tables if necessary. * * @param \Nova\Routing\Route $route * @return void */ protected function addLookups($route) { // If the route has a name, we will add it to the name look-up table so that we // will quickly be able to find any route associate with a name and not have // to iterate through every route every time we need to perform a look-up. $action = $route->getAction(); if (isset($action['as'])) { $this->nameList[$action['as']] = $route; } // When the route is routing to a controller we will also store the action that // is used by the route. This will let us reverse route to controllers while // processing a request and easily generate URLs to the given controllers. if (isset($action['controller'])) { $this->addToActionList($action, $route); } }
/** * Merge the group stack with the controller action. * * @param \Nova\Routing\Route $route * @return void */ protected function mergeController($route) { $action = $this->mergeWithLastGroup($route->getAction()); $route->setAction($action); }