Bootstrap the application services.
@param \Illuminate\Routing\Router $router
960428
public function boot(Router $router)
    {
        if (!$this->app->routesAreCached()) {
            require __DIR__ . '/../routes.php';
        }

        $this->loadMigrationsFrom(__DIR__ . '/../migrations');
        $router->aliasMiddleware('didbot.xml-http-request', \Didbot\DidbotApi\Middleware\XmlHttpRequest::class);
        $router->aliasMiddleware('didbot.throttle', \Didbot\DidbotApi\Middleware\ThrottleRequest::class);

        Passport::routes();


        Validator::extend('iso8601', function ($attribute, $value, $parameters, $validator) {

            return (preg_match('/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/',
                    $value) === 1);
        });

        Validator::extend('uuid', function ($attribute, $value, $parameters, $validator) {

            return (preg_match('/^[a-f\d]{8}-(?:[a-f\d]{4}-){3}[a-f\d]{12}$/i',
                    $value) === 1);

        });

        Validator::extend('geo', function ($attribute, $value, $parameters, $validator) {

            return (preg_match('/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/',
                    $value) === 1);

        });


        // Custom names for the Polymorphic relation on the Didbot\DidbotApi\Models\Source model
        Relation::morphMap([
            'client' => 'Laravel\Passport\Client',
            'token' => 'Laravel\Passport\Token',
        ]);
    }
577090
public function boot(Router $router)
    {
        $this->publishes([
            __DIR__.'/Config/charts.php' => config_path('charts.php'),
        ], 'charts_config');

        $this->loadViewsFrom(__DIR__.'/Views', 'charts');

        $this->publishes([
            __DIR__.'/Views' => resource_path('views/vendor/charts'),
        ]);

        if ($this->app->runningInConsole()) {
            $this->commands([
                \ConsoleTVs\Charts\Commands\ChartsCommand::class,
            ]);
        }
    }
1309988
protected function loadRoutes(Router $router)
    {
        $router->group([
            'namespace' => $this->namespace,
            'middleware' => config('forum.frontend.middleware'),
            'as' => config('forum.routing.as'),
            'prefix' => config('forum.routing.prefix')
        ], function ($router) {
            Forum::routes($router);
        });
    }
468775
public function boot(Router $router)
    {
        /** @var Application $app */
        $app = $this->app;

        $this->commands($this->commands);

        if (!$app->routesAreCached()) {
            $this->loadRoutes($router);
        }

        $this->loadMigrations();

        $this->loadTranslations();

        $this->registerPublishes();
    }
1358677
public function boot(Router $router)
	{
		$configPath = __DIR__.'/../config/theme.php';

		// Publish config.
		$this->publishes([$configPath => config_path('theme.php')], 'config');
	
	    $router->aliasMiddleware('theme', Middleware\ThemeLoader::class);

	    // Register blade directives:
		$this->addToBlade(['dd', 'dd(%s);']);
		$this->addToBlade(['dv', 'dd(get_defined_vars()[%s]);', 'dd(get_defined_vars()["__data"]);']);
		$this->addToBlade(['d', 'dump(%s);']);


		$this->addToBlade(['get', 'Theme::get(%s);']);
		$this->addToBlade(['getIfHas', 'Theme::has(%1$s) ? Theme::get(%1$s) : ""']);

		$this->addToBlade(['partial', 'Theme::partial(%s);']);
		$this->addToBlade(['sections', 'Theme::partial("sections.".%s);']);
		$this->addToBlade(['content', null, 'Theme::content();']);

		$this->addToBlade(['asset', 'Theme::asset()->absUrl(%s);']);

		$this->addToBlade(['protect', 'protectEmail(%s);']);

		$this->addToBlade(['styles', 'Theme::asset()->container(%s)->styles();', 'Theme::asset()->styles();']);
		$this->addToBlade(['scripts', 'Theme::asset()->container(%s)->scripts();', 'Theme::asset()->scripts();']);

		$this->addToBlade(['widget', 'Theme::widget(%s)->render();']);
	}
687440
public function boot()
    {
        $this->setupPackage();

        $this->setupBlade($this->app->view);

        $this->setupRoutes($this->app->router);
    }
588024
public function bootApiRouting(Router $router)
    {
        if (!$this->app->make('antares.request')->shouldMakeApiResponse()) {
            return;
        }

        $routerAdapter = $this->app->make(Adapter::class);
        $routes        = [];


        /* @var $route \Illuminate\Routing\Route */
        foreach ($router->getRoutes()->getRoutes() as $route) {
            $routeActionName = $route->getActionName();

            if (starts_with($routeActionName, $this->namespace)) {
                $routes[] = $route;
            }
        }


        $routerAdapter->adaptRoutes($routes, $this->namespace);
    }
905261
public function map(Router $router)
    {
        $api = app('Dingo\Api\Routing\Router');

        $this->loadApiRoutes($api, $router);

        $router->group(['namespace' => $this->namespace], function (Router $router) {
            $this->loadBackendRoutes($router);
            $this->loadFrontendRoutes($router);
        });
    }
742023
public function boot(\Illuminate\Routing\Router $router)
    {
        // Load middlewares
        $router->aliasMiddleware('laralum.base', Middleware\LaralumBase::class);
        $router->aliasMiddleware('laralum.auth', Middleware\LaralumAuth::class);

        $this->loadTranslationsFrom(__DIR__.'/Translations', 'laralum');

        $this->publishes([
            __DIR__.'/../config/laralum.php' => config_path('laralum.php'),
        ], 'laralum_config');

        $this->loadViewsFrom(__DIR__.'/Views', 'laralum');

        if (!$this->app->routesAreCached()) {
            require __DIR__.'/Routes/web.php';
            require __DIR__.'/Routes/api.php';
        }

        // Manually register other user packages
        $this->app->register('ConsoleTVs\\Charts\\ChartsServiceProvider');
        $this->app->register('Unicodeveloper\\Identify\\IdentifyServiceProvider');
        $this->app->register('Aitor24\\Localizer\\LocalizerServiceProvider');

        // Make sure the permissions are OK
        PermissionsChecker::check($this->permissions);

        // Mass service provider registerer & menu creator
        foreach (Packages::all() as $package) {
            $provider = Packages::provider($package);
            if ($provider) {
                if (class_exists('Laralum\\'.ucfirst($package)."\\$provider")) {
                    $this->app->register('Laralum\\'.ucfirst($package)."\\$provider");
                } elseif (class_exists('Laralum\\'.strtoupper($package)."\\$provider")) {
                    $this->app->register('Laralum\\'.strtoupper($package)."\\$provider");
                }
            }
        }

        if ($this->app->runningInConsole()) {
            $this->commands([
                LaralumInfo::class,
                LaralumPackages::class,
                LaralumPublish::class,
                LaralumSuperAdmins::class,
                LaralumSettings::class,
                LaralumCreatePackage::class,
            ]);
        }
    }
199661
public function boot(Router $router)
    {
        $router->middlewareGroup('checkHTTPS', [CheckHTTPS::class]);
        $router->middlewareGroup('forceHTTPS', [ForceHTTPS::class]);
        $this->loadTranslationsFrom(__DIR__.'/resources/lang/', 'LaravelHttps');
    }
1153353
public function boot(Router $router)
	{
        $viewPath = __DIR__.'/../resources/views';
        $this->loadViewsFrom($viewPath, 'translation-manager');
        $this->publishes([
            $viewPath => base_path('resources/views/vendor/translation-manager'),
        ], 'views');

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

        $config = $this->app['config']->get('translation-manager.route', []);
        $config['namespace'] = 'Barryvdh\TranslationManager';

        $router->group($config, function($router)
        {
            $router->get('view/{groupKey?}', 'Controller@getView')->where('groupKey', '.*');
            $router->get('/{groupKey?}', 'Controller@getIndex')->where('groupKey', '.*');
            $router->post('/add/{groupKey}', 'Controller@postAdd')->where('groupKey', '.*');
            $router->post('/edit/{groupKey}', 'Controller@postEdit')->where('groupKey', '.*');
            $router->post('/groups/add', 'Controller@postAddGroup');
            $router->post('/delete/{groupKey}/{translationKey}', 'Controller@postDelete')->where('groupKey', '.*');
            $router->post('/import', 'Controller@postImport');
            $router->post('/find', 'Controller@postFind');
            $router->post('/locales/add', 'Controller@postAddLocale');
            $router->post('/locales/remove', 'Controller@postRemoveLocale');
            $router->post('/publish/{groupKey}', 'Controller@postPublish')->where('groupKey', '.*');
            $router->post('/translate-missing', 'Controller@postTranslateMissing');
        });
	}
1185404
public function boot(Router $router): void
    {
        // Attach request macro
        $this->attachRequestMacro();

        // Map bouncer models
        Bouncer::useRoleModel(config('cortex.auth.models.role'));
        Bouncer::useAbilityModel(config('cortex.auth.models.ability'));

        // Map bouncer tables (users, roles, abilities tables are set through their models)
        Bouncer::tables([
            'permissions' => config('cortex.auth.tables.permissions'),
            'assigned_roles' => config('cortex.auth.tables.assigned_roles'),
        ]);

        // Bind route models and constrains
        $router->pattern('role', '[a-zA-Z0-9-]+');
        $router->pattern('ability', '[a-zA-Z0-9-]+');
        $router->pattern('session', '[a-zA-Z0-9-]+');
        $router->pattern('admin', '[a-zA-Z0-9-]+');
        $router->pattern('member', '[a-zA-Z0-9-]+');
        $router->pattern('manager', '[a-zA-Z0-9-]+');
        $router->model('role', config('cortex.auth.models.role'));
        $router->model('admin', config('cortex.auth.models.admin'));
        $router->model('member', config('cortex.auth.models.member'));
        $router->model('manager', config('cortex.auth.models.manager'));
        $router->model('guardian', config('cortex.auth.models.guardian'));
        $router->model('ability', config('cortex.auth.models.ability'));
        $router->model('session', config('cortex.auth.models.session'));

        // Map relations
        Relation::morphMap([
            'role' => config('cortex.auth.models.role'),
            'admin' => config('cortex.auth.models.admin'),
            'member' => config('cortex.auth.models.member'),
            'manager' => config('cortex.auth.models.manager'),
            'guardian' => config('cortex.auth.models.guardian'),
            'ability' => config('cortex.auth.models.ability'),
        ]);

        // Load resources
        require __DIR__.'/../../routes/breadcrumbs/adminarea.php';
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/adminarea.php');
        $this->loadViewsFrom(__DIR__.'/../../resources/views', 'cortex/auth');
        $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'cortex/auth');
        ! $this->app->runningInConsole() || $this->loadMigrationsFrom(__DIR__.'/../../database/migrations');
        $this->app->runningInConsole() || $this->app->afterResolving('blade.compiler', function () {
            require __DIR__.'/../../routes/menus/managerarea.php';
            require __DIR__.'/../../routes/menus/tenantarea.php';
            require __DIR__.'/../../routes/menus/adminarea.php';
            require __DIR__.'/../../routes/menus/frontarea.php';
        });

        // Publish Resources
        ! $this->app->runningInConsole() || $this->publishResources();

        // Register event handlers
        $this->app['events']->subscribe(GenericHandler::class);

        // Register attributes entities
        ! app()->bound('rinvex.attributes.entities') || app('rinvex.attributes.entities')->push('admin');
        ! app()->bound('rinvex.attributes.entities') || app('rinvex.attributes.entities')->push('member');
        ! app()->bound('rinvex.attributes.entities') || app('rinvex.attributes.entities')->push('manager');

        // Override middlware
        $this->overrideMiddleware($router);

        // Register menus
        $this->registerMenus();

        // Share current user instance with all views
        $this->app['view']->composer('*', function ($view) {
            ! config('rinvex.tenants.active') || $view->with('currentTenant', config('rinvex.tenants.active'));
            $view->with('currentUser', auth()->guard(request()->route('guard'))->user());
        });
    }
550500
public function boot()
    {
        $router = $this->app->make(Router::class);
        $path   = realpath(__DIR__ . '/../../');
        $this->addConfigComponent('antares/foundation', 'antares/foundation', $path . '/resources/config');
        $this->addLanguageComponent('antares/foundation', 'antares/foundation', $path . '/resources/lang');
        $this->assignAreaTemplate();


        $this->appendWidgetsDefaultConfig();
        if (!$this->app->routesAreCached()) {
            require "{$path}/src/routes.php";
        }

        $router->aliasMiddleware('antares.forms', FormMiddleware::class);
        $router->aliasMiddleware('antares.ui-components', UIComponentsMiddleware::class);
        $this->runtime();


        $this->app->make('events')->fire('antares.ready');
        $this->app->make('events')->fire(new AntaresReady());
        $this->app->make('view')->composer(['antares/foundation::account.index', 'antares/logger::admin.devices.*'], \Antares\Users\Http\Handlers\AccountPlaceholder::class);

        if ($this->app->bound('antares.watchdog')) {
            $this->app->make('events')->subscribe(AfterExtensionOperation::class);
        }

        $this->app->make('view')->composer('antares/foundation::breadcrumbs.bootstrap3', function($view) {
            view()->share('breadcrumbs_data', array_get($view->getData(), 'breadcrumbs', []));
        });

        $this->app->make('events')->listen(LoadServiceProviders::class, function() {
            $widgets = $this->app->make('antares.ui-components.finder')->detectRoutes();

            $widgets->each(function($widget) {
                if (class_exists($widget)) {
                    $widget::routes();
                }
            });
        });
        $this->app->bind('languages', function($app) {
            return new Languages($app);
        });
    }
1231982
public function boot(\Illuminate\Routing\Router $router)
    {
        if (!$this->app->routesAreCached()) {
            require __DIR__.'/Routes/web.php';
        }

        $this->publishes([
            __DIR__.'/Config/localizer.php' => config_path('localizer.php'),
        ], 'localizer_config');

        $this->publishes([
            __DIR__.'/Config/localizer_languages.php' => config_path('localizer_languages.php'),
        ], 'localizer_languages');

        $router->aliasMiddleware('localizer', config('localizer.middleware'));
        $this->app->register(IdentifyServiceProvider::class);

        $this->publishes([
                __DIR__.'/Migrations/2016_11_28_115831_add_locale_column.php' => $this->app->databasePath().'/migrations/'.date('Y_m_d_His', time()).'_add_locale_column.php',
        ], 'localizer_migrations');

        if (!config('localizer.dynamic_migration_name')) {
            $this->loadMigrationsFrom(__DIR__.'/Migrations', 'localizer');
        }
    }
758343
public function boot()
    {
        $this->setRootControllerNamespace();

        $this->loadRoutes();

        $this->app->booted(function () {
            $this->refreshRoutes($this->app['router']);
        });
    }
703231
public function map(Router $router)
    {
        $router->group($this->routeAttributes(), function(Router $router) {
            LogViewerRoute::register($router);
        });
    }
975502
public function boot(Router $router)
    {
        $this->publishConfigs();
        $this->bootViews();
        $this->bootAssets();
        $this->bootCommands();
        $this->publishDatabaseFiles();
        $this->registerMorphmaps();
        $this->registerBladeExtensions();
    }