Registers a new route provider to feed new routes

@param RouteProvider $provider
350263
public function addRouteProvider(RouteProvider $provider)
    {
        foreach ($provider->routes() as $route) {
            $this->add($route);
        }
    }
701662
public function addProvider($provider)
    {
        if (is_string($provider)) {
            $provider = new $provider($this);
        }

        // Only allow a service provider to be registered
        // once.
        if (in_array($provider, $this->providers)) {
            return;
        }

        $this->providers[] = $provider;

        $this->registerEvents($provider);
        $this->registerProvides($provider);

        $this->registerProvider($provider);
    }
170545
public function register(
        ServiceProviderInterface $provider,
        array $items = []
    ): self {
        $provider->register($this);
        foreach ($items as $key => $value) {
            $this[$key] = $value;
        }
        return $this;
    }
913057
protected function addProvider($provider)
    {
        $className = $this->resolveProviderClass($provider);

        $this->providers[$provider] = $this->buildProvider($className);
    }
994111
public function register()
    {
        // Auto register the support service provider
        if (! get_class($this) == SupportServiceProvider::class) {
            $this->app->register(SupportServiceProvider::class);
        }

        $this->viewsPath  = Str::replace($this->viewsPath, '{resourcesPath}', $this->getResourcesPath());
        $this->assetsPath = Str::replace($this->assetsPath, '{resourcesPath}', $this->getResourcesPath());

        $router = $this->app->make('router');
        $kernel = $this->app->make('Illuminate\Contracts\Http\Kernel');

        $this->registerConfigFiles();

        foreach ($this->prependMiddleware as $middleware) {
            $kernel->prependMiddleware($middleware);
        }

        foreach ($this->middleware as $middleware) {
            $kernel->pushMiddleware($middleware);
        }

        foreach ($this->routeMiddleware as $key => $middleware) {
            $router->middleware($key, $middleware);
        }

        foreach ($this->providers as $provider) {
            $this->app->register($provider);
        }

        foreach ($this->deferredProviders as $provider) {
            $this->app->registerDeferredProvider($provider);
        }

        foreach ($this->bindings as $binding => $class) {
            $this->app->bind($binding, $class);
        }

        foreach ($this->singletons as $binding => $class) {
            if ($this->strict && ! class_exists($class) && ! interface_exists($class)) {
                throw new \Exception(get_called_class() . ": Could not find alias class [{$class}]. This exception is only thrown when \$strict checking is enabled");
            }
            $this->app->singleton($binding, $class);
        }

        foreach ($this->aliases as $alias => $full) {
            if ($this->strict && ! class_exists($full) && ! interface_exists($full)) {
                throw new \Exception(get_called_class() . ": Could not find alias class [{$full}]. This exception is only thrown when \$strict checking is enabled");
            }
            $this->app->alias($alias, $full);
        }

        if (is_array($this->commands) and count($this->commands) > 0) {
            $this->commands($this->commands);
        }

        AliasLoader::getInstance($this->facades)->register();

        $this->requireHelpersFor('register');

        return $this->app;
    }
126778
protected function registerProvider(ServiceProvider $provider, $force = false, $binding = null)
    {
        if ($this->providerIsRegistered($provider) 
            and $binding and $this->bound($binding, false)) return;

        $events = $provider->when();
        $provides = $provider->provides();

        if ($force or (empty($events) and empty($provides))) {
            if (method_exists($provider, 'register')) {
                $provider->register($binding);
            }

            if (method_exists($provider, 'aliases')) {
                $this->aliases = array_merge($this->aliases, $provider->aliases());
            }

            $this->registered[] = $provider;
        }
    }
1185802
public function register(ServiceProviderInterface $provider, array $values = [])
    {
        $this->container->register($provider, $values);
        // register event subcriber
        if ($provider instanceof EventSubscriberInterface) {
            $this->eventSubscribers[] = $provider;
        }

        return $this;
    }
934392
protected function registerProviders(): void
    {
        foreach ($this->providers as $provider) {
            $this->app->register($provider);
        }
    }
1153148
public function registerDeferredProvider($provider, $service = null)
	{
		// Once the provider that provides the deferred service has been registered we
		// will remove it from our local list of the deferred services with related
		// providers so that this container does not try to resolve it out again.
		if ($service) unset($this->deferredServices[$service]);

		$this->register($instance = new $provider($this));

		if ( ! $this->booted)
		{
			$this->booting(function() use ($instance)
			{
				$this->bootProvider($instance);
			});
		}
	}
324761
protected function registerProviders()
    {
        // register rollbar service provider
        if (class_exists(HCRollbarServiceProvider::class))
            $this->app->register(HCRollbarServiceProvider::class);

        // register LogViewer service provider
        if (class_exists(LaravelLogViewerServiceProvider::class))
            $this->app->register(LaravelLogViewerServiceProvider::class);
    }
514172
public function setProviders($providers)
    {
        $this->guardForArrayOrTraversable($providers);

        foreach ($providers as $provider) {
            $this->addProvider($provider);
        }
    }
679237
private function registerProvider()
    {
        $app = $this->app;

        // Pick the correct service provider for the current verison of Laravel
        $this->provider = (version_compare($app::VERSION, '5.0', '<'))
            ? new TmdbServiceProviderLaravel4($app)
            : new TmdbServiceProviderLaravel5($app);
    }
1102758
public function registerProvidersFor($binding)
    {
        foreach ($this->provides($binding) as $provider) {
            $this->registerProvider($provider, true, $binding);
        }
    }
513523
public function bindRoutes()
    {
        $loader = new RouteLoader();

        $loader->registerProviders(RouteLoader::$defaultProviders);

        $loader->bindRoutes($this);
        $this->bindPluginRoutes('plugin.controller_providers.root');
    }
695529
public function add(Route $route)
    {
        $this->addRoute($route->methods(), $route->uri(), $route->handler(), $route->name());
    }
968559
public function registerProvider(ProviderInterface $provider)
    {
        if (null !== $provider) {
            $this->providers[$provider->getName()] = $provider;
        }

        return $this;
    }
280686
public function register(App $app)
    {
        // new Route class instance
        $app["router.newRoute"] = $app->factory(function () {
            return new Route;
        });

        /*
         * Routes Container
         *
         * Requires the Logger Service Provider to be registered prior to its
         * own instantiation.
         */
        $app["routesContainer.service"] = function (App $app) {
            return new RoutesContainer($app["logger.service"]("System"));
        };

        /*
         * Route Dispatcher
         *
         * Requires the Routes Container, the Hooks Container, and the Logger.
         * This Service gathers all required services, and instantiates the
         * Dispatcher. Just make sure all required service providers are
         * registered prior to instantiating the Dispatcher
         */
        $app["routeDispatcher.service"] = function (App $app) {
            $dispatcher = new RouteDispatcher(
                $app["routesContainer.service"],
                $app["hooks.service"],
                $app["logger.service"]("System")
            );

            $config = $app["config.service"];
            if ($config["app.segmentBasedMatch"] === true) {
                $dispatcher->enableSegMatch(
                    $config["app.controllerNamespace"],
                    [$app],
                    $config["app.segmentBasedUriPrepend"],
                    $config["app.segmentBasedDefaultMethod"]
                );
            }
            return $dispatcher;
        };

        // new Request object from superglobals or pre set base url
        $app["request.service"] = function (App $app) {
            if (isset($app["requestParams"])) {
                $method = $app["requestParams"]["method"] ?? $_SERVER["REQUEST_METHOD"];
                $request = Request::create(
                    $app["requestParams"]["uri"],
                    $method,
                    array_merge($_GET, $_POST),
                    $_COOKIE,
                    $_FILES,
                    $_SERVER
                );

                /*
                 * prepare request parameters from request content, copy from
                 * Symfony Http Foundation Request method "createFromGlobals"
                 */
                if (strpos($request->headers->get("CONTENT_TYPE"), "application/x-www-form-urlencoded") === 0
                    && in_array(strtoupper($request->server->get("REQUEST_METHOD", "GET")),
                        ["PUT", "DELETE", "PATCH"])) {
                    parse_str($request->getContent(), $data);
                    $request->request = new ParameterBag($data ?? []);
                }
            } else {
                $request = Request::createFromGlobals();
            }

            return $request;
        };

        // new empty Response object
        $app["response.service"] = function () {
            return new Response;
        };
    }