Dingo\Api\Routing\UrlGenerator::setRouteCollections PHP Method

setRouteCollections() public method

Set the route collection instance.
public setRouteCollections ( array $collections )
$collections array
    public function setRouteCollections(array $collections)
    {
        $this->collections = $collections;
    }

Usage Example

Esempio n. 1
0
 /**
  * Register the URL generator.
  */
 protected function registerUrlGenerator()
 {
     $this->app->singleton('api.url', function ($app) {
         $url = new UrlGenerator($app['request']);
         $url->setRouteCollections($app[Router::class]->getRoutes());
         return $url;
     });
 }