Application booted, let's dispatch the routes.

@return callable
950
protected function dispatchToRouter() : Closure
    {
        return function ($request) {
            return $this->router->setContainer($this->container)->dispatch($request);
        };
    }
337081
public function boot()
    {
        parent::boot();
        $router = $this->app->make(Router::class);


        $this->app->bind(RouterAdapter::class, function($app) {
            return new RouterAdapter($app->make(ApiRouter::class), $app->make(ControllerFinder::class), $app['config']['api']);
        });
        $this->app->bind('api-roles', function() {
            return new ApiRoles();
        });
        if (!App::runningInConsole()) {
            $this->registerApiAuth($this->app->make(AuthProviderService::class));
        }
        $router->pushMiddlewareToGroup('api', ApiMiddleware::class);
        $this->app->make('view')->composer(['antares/api::admin.user.*'], AccountPlaceholder::class);
        $this->app->make('view')->composer(['antares/foundation::account.*', 'antares/logger::admin.devices.*', 'antares/api::admin.user.*'], MenuUser::class);
        $this->app->make('view')->composer('antares/api::admin.configuration.*', ControlPane::class);
    }
276788
public function boot()
    {
        parent::boot();

        if (Request::is('*/calendar/calendar/*')) {
            Route::bind('calendar', function ($id) {
                $calendar = $this->app->make('Litepie\Calendar\Interfaces\CalendarRepositoryInterface');
                return $calendar->findorNew($id);
            });
        }

    }
129187
public function boot()
    {
        $this->bootPublish();

        // Extends Url Generator
        $this->app->bind('url', function ($app) {
            return new UrlGenerator(
                $app['router']->getRoutes(),
                $app['request']
            );
        });
    }
751315
public function boot()
    {
        $this->registerResources();
        $this->registerServiceProviders();
        $this->registerAliases();
        $this->registerModuleRegistry();
        $this->registerCommands();
        $this->registerRoutesAndMiddlewares();
        $this->registerFields();
        $this->registerGeneratorStubs();
        $this->registerLocales();
        $this->registerViewComposers();
        $this->registerValidationRules();
        $this->registerAssets();

        $this->app->singleton( SecurityStrategy::class, function()
        {
            return $this->app->make( SessionSecurityService::class );
        } );

        $this->loadTranslationsFrom( __DIR__ . '/resources/lang', 'arbory' );
    }
1188397
public function boot()
    {
        if ($this->booted) {
            return;
        }

        \array_walk($this->loadedProviders, function ($p) {
            $this->bootProvider($p);
        });

        // Once the application has booted we will also fire some "booted" callbacks
        // for any listeners that need to do work after this initial booting gets
        // finished. This is useful when ordering the boot-up processes we run.
        $this->fireAppCallbacks($this->bootingCallbacks);

        $this->booted = true;

        $this->fireAppCallbacks($this->bootedCallbacks);
    }
1283270
public function boot()
    {
        if (file_exists($routes = api_path('routes.php'))) {
            $this->loadRoutesFrom($routes);
        }

        if ($this->app->runningInConsole()) {
            $this->publishes([
                __DIR__ . '/../../config' => config_path()
            ], 'laravel-api-config');
        }
    }
475394
public function boot()
    {
        // Get routes
        include __DIR__.'/App/Http/routes.php';
        
        // Get views
        if (file_exists(base_path('resources/views/vendor/redooor/redminportal'))) {
            $this->loadViewsFrom(base_path('resources/views/vendor/redooor/redminportal'), 'redminportal');
        } else {
            $this->loadViewsFrom(__DIR__.'/resources/views', 'redminportal');
        }
        
        // Establish Translator Namespace
        $this->loadTranslationsFrom(__DIR__.'/resources/lang', 'redminportal');
        
        // Allow end users to publish and modify views
        $this->publishes([
            __DIR__.'/resources/views/' => base_path('resources/views/vendor/redooor/redminportal/'),
        ], 'views');
        
        // Allow end users to publish and modify public assets
        $this->publishes([
            __DIR__.'/public/' => public_path('vendor/redooor/redminportal/'),
        ], 'public');
        
        // Publish a config file
        $this->publishes([
            __DIR__.'/config/' => config_path('vendor/redooor/redminportal/')
        ], 'config');
        
        // Publish your migrations
        $this->publishes([
            __DIR__.'/database/migrations/' => base_path('database/migrations/vendor/redooor/redminportal/')
        ], 'migrations');
    }
644181
public function boot()
    {
        if ($this->booted) {
            return;
        }

        $this->booted = true;

        foreach ($this->providers as $provider) {
            if ($provider instanceof EventListenerProviderInterface) {
                $provider->subscribe($this, $this['dispatcher']);
            }

            if ($provider instanceof BootableProviderInterface) {
                $provider->boot($this);
            }
        }
    }
520568
public function dispatch()
    {
        $handler = [$this->controller, 'initialize'];
        if (method_exists($this->controller, 'initialize') && is_callable($handler)) {
            call_user_func($handler);
        }

        $this->isCallableOrException();

        return call_user_func_array([$this->controller, $this->action], $this->params);
    }
580366
public function boot()
    {
        $this->registerPolicies();

        // Dynamically register permissions with Laravel's Gate.
        foreach ($this->getPermissions() as $permission) {
            Gate::define($permission->name, function (User $user) use ($permission) {
                return $user->hasPermission($permission);
            });
        }
    }
971588
public function boot()
    {
        $this->publishes([
            $this->configPath => $this->app->configPath().'/fb-messenger.php',
        ], 'config');

        $this->publishes([
            $this->menuPath => $this->app->basePath().'/routes/menu.php',
        ], 'menu');

        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laravel-fb-messenger');
        $this->publishes([__DIR__.'/../public' => $this->app->basePath().'/public/vendor'], 'public');

        if ($this->app['config']->get('fb-messenger.debug')) {
            $this->app->extend(ExceptionHandler::class, function ($exceptionHandler, $app) {
                $debug = $app->make(Debug::class);
                return new Handler($exceptionHandler, $debug);
            });
        }
    }
1311161
public function boot()
    {
        if (! $this->app->routesAreCached()) {
            require __DIR__.'/Routes/routes.php';
        }

        $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'laravel-modules-base');
        $this->publishes([
            __DIR__.'/../resources/lang' => base_path('resources/lang/vendor/laravel-modules-base'),
        ]);

        $this->publishes([
            __DIR__.'/../database/migrations/' => database_path('migrations')
        ], 'migrations');

        $this->publishes([
            __DIR__.'/../config/laravel-modules-base.php'   => config_path('laravel-modules-base.php')
        ], 'config');

        $this->loadViewsFrom(__DIR__.'/../resources/views', 'laravel-modules-base');
        $this->publishes([
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/laravel-modules-base'),
        ]);
    }
1156044
public function bootstrap()
    {

        // Start the rudimental system
        try {

            // Load settingsfile
            $this->loadSettings();

            // From here starts output buffering
            ob_start();

            // Registe PSR classloader
            $this->registerClassloader();

            // Create core DI container instance and map the instance to comntainer
            $this->di = \Core\DI\DI::getInstance();
            $this->di->mapValue('core.di', $this->di);

            $this->initLogger();

            // Run inits
            $this->initDatabase();
            $this->initMessageHandler();
            $this->initDependencies();
            $this->initHttp();
            $this->initSession();
            $this->initConfig();
            $this->initMailer();
            $this->initRouter();

            // Get an instance of Core app
            $this->getAppInstance('Core');

            $this->initSecurity();
            $this->initPage();
            $this->initAssetManager();

            // Run highlevel system
            $this->autodiscoverApps();

            // Match request against the generic routes to get the ajax request flag and to match a fallback result.
            $this->router->match();

            // Initiate apps
            $this->initApps();

            // Match routes again as now possible app routes are available
            $this->router->match();

            // Run dispatcher
            $result = $this->dispatch();

            // Send mails
            $this->mailer->send();

            // Process all assets
            $this->processAssets();

            // Send cookies
            $this->http->cookies->send();

            // Redirect requested?
            if (!empty($_SESSION['Core']['redirect'])) {

                $this->http->header->location($_SESSION['Core']['redirect']['location'], $_SESSION['Core']['redirect']['permanent']);
                $this->http->header->send();

                // Important: Clear redirect from session!
                unset($_SESSION['Core']['redirect']);

                return;
            }

            switch ($this->router->getFormat()) {

                case 'file':
                    $sendfile = new Sendfile($result);
                    $sendfile->send();

                    break;

                case 'html':

                    $this->http->header->contentType('text/html', 'utf-8');

                    $language = $this->getAppInstance('Core')->language;

                    // Add logoff button for logged in users
                    if ($this->user->isGuest()) {
                        $this->page->menu->createItem('register', $language->get('menu.register'), $this->router->generate('core.register'));
                        $this->page->menu->createItem('login', $language->get('menu.login'), $this->router->generate('core.login', [
                            'action' => 'login'
                        ]));
                    }

                    // or add login and register buttons. But not when current user is currently on banlist
                    else {

                        $usermenu = $this->page->menu->createItem('login', $this->user->getDisplayname());

                        // Show admin menu?
                        if ($this->user->getAdmin()) {
                            $usermenu->createItem('admin', $language->get('menu.admin'), $this->router->generate('core.admin'));
                        }

                        $usermenu->createItem('logout', $language->get('menu.logout'), $this->router->generate('core.login', [
                            'action' => 'logout'
                        ]));
                    }

                    $this->page->setHome($this->config->get('Core', 'url.home'));
                    $this->page->setContent($result);

                    $result = $this->page->render();
            }

            // Send headers so far
            $this->http->header->send();
        }
        catch (\Throwable $t) {

            $error = new ErrorHandler($t);
            $error->setAjax(isset($_REQUEST['ajax']));
            $error->setPublic(isset($this->user) && $this->user->getAdmin());
            $error->setPublic(true);

            if (isset($this->logger)) {
                $error->setLogger($this->logger);
            }

            http_response_code(500);

            $result = $error->handle();
        }

        echo $result;

        ob_end_flush();
    }
1249308
public function run()
    {
        $routeInfo = $this->getRouter()->filter();
        $event = new Dispatch([
            'application' => $this,
            'routeInfo' => $routeInfo
        ]);
        $this->getEventManager()
            ->trigger(Dispatch::BEFORE_DISPATCH, $this, $event);
        $response = $this->dispatcher->dispatch($routeInfo);
        $event->response = $response;
        $this->getEventManager()
            ->trigger(Dispatch::AFTER_DISPATCH, $this, $event);
        return $event->response;
    }
1356076
private function bootForRequest()
    {
        $request = Request::getInstance();

        //Set error configuration and logging options
        $this->setErrorConfigurations($request);

        //Match routes
        $route = Router::getInstance()->matchRequest($request);
        abort_unless($route instanceof Route, 404);

        //Get target controller or closure
        $target = $route->getTarget();
        if (!$target instanceof Closure) {
            $target = $this->getControllerLogic($target);
        }

        return [$route, $target];
    }
478386
public function boot()
    {
        $this->registerConfig();
        $this->registerViewComposers();

        $this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
        $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', config('openid.namespace'));
        $this->loadViewsFrom(__DIR__ . '/../Resources/views', config('openid.namespace'));

        $this->app->singleton('openid', function ($app) {
            return new Client();
        });

        $this->app->singleton('oauth2', function ($app) {
            return new Api();
        });
    }