SebastiaanLuca\Router\RouterServiceProvider::registerUserRouters PHP Method

registerUserRouters() protected method

Map user-defined routers.
protected registerUserRouters ( )
    protected function registerUserRouters()
    {
        // We can safely assume the Kernel contract is the application's
        // HTTP kernel as it is bound in bootstrap/app.php to the actual
        // implementation. Still need to check if it's the package's
        // custom kernel though as that is an optional setup choice.
        $kernel = $this->getApplicationKernel();
        if (!$kernel instanceof Kernel) {
            return;
        }
        $routers = $kernel->getRouters();
        // Just instantiate each router as they handle the mapping itself
        foreach ($routers as $router) {
            $this->app->make($router);
        }
    }