Alias the services in the boot.
551803
public function boot()
    {
        $this->publishes([
            __DIR__.'/PublishedAssets/Views/themes' => base_path('resources/themes'),
            __DIR__.'/PublishedAssets/Controllers' => app_path('Http/Controllers/Cms'),
            __DIR__.'/PublishedAssets/Middleware' => app_path('Http/Middleware'),
            __DIR__.'/PublishedAssets/Routes' => base_path('routes'),
            __DIR__.'/PublishedAssets/Config' => base_path('config'),
        ]);

        $this->publishes([
            __DIR__.'/Views' => base_path('resources/views/vendor/cms'),
        ], 'backend');

        $this->loadMigrationsFrom(__DIR__.'/Migrations');

        $theme = config('cms.frontend-theme', 'default');

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

        View::addLocation(base_path('resources/themes/'.$theme));
        View::addNamespace('cms-frontend', base_path('resources/themes/'.$theme));

        /*
        |--------------------------------------------------------------------------
        | Blade Directives
        |--------------------------------------------------------------------------
        */

        Blade::directive('theme', function ($expression) {
            if (Str::startsWith($expression, '(')) {
                $expression = substr($expression, 1, -1);
            }

            $theme = config('cms.frontend-theme');
            $view = '"cms-frontend::'.str_replace('"', '', str_replace("'", '', $expression)).'"';

            return "<?php echo \$__env->make($view, array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>";
        });

        Blade::directive('menu', function ($expression) {
            return "<?php echo Cms::menu($expression); ?>";
        });

        Blade::directive('block', function ($expression) {
            $module = Cms::getModule();
            return "<?php echo optional(\$".$module.")->block($expression); ?>";
        });

        Blade::directive('languages', function ($expression) {
            return "<?php echo Cms::languageLinks($expression); ?>";
        });

        Blade::directive('modules', function ($expression) {
            return "<?php echo Cms::moduleLinks($expression); ?>";
        });

        Blade::directive('widget', function ($expression) {
            return "<?php echo Cms::widget($expression); ?>";
        });

        Blade::directive('promotion', function ($expression) {
            return "<?php echo Cms::promotion($expression); ?>";
        });

        Blade::directive('image', function ($expression) {
            return "<?php echo Cms::image($expression); ?>";
        });

        Blade::directive('image_link', function ($expression) {
            return "<?php echo Cms::imageLink($expression); ?>";
        });

        Blade::directive('images', function ($expression) {
            return "<?php echo Cms::images($expression); ?>";
        });

        Blade::directive('edit', function ($expression) {
            return "<?php echo Cms::editBtn($expression); ?>";
        });

        Blade::directive('editBtn', function ($expression) {
            return "<?php echo Cms::editBtnSecondary($expression); ?>";
        });

        Blade::directive('markdown', function ($expression) {
            return "<?php echo Markdown::convertToHtml($expression); ?>";
        });
    }
1045257
public function boot()
    {
        if ($this->booted) {
            return;
        }

        parent::boot();

        foreach ($this->events as $eventsNames) {
            $this->forwardEventsToPushServer($eventsNames);
        }

        $this->events = [];
    }
701969
def apply(self, reboot=False):
        """"""
        self.root.use_virtual_addresses = True
        self.root.manage.manage = True
        self.root.mode = 'new'
        self.root.init_boot = reboot

        self.client.set_profile(self.root.get_json())
47075
protected function bootModules()
    {
        // Create instances
        $this->container = new ContainerModule();
        $this->service = new ServiceModule();

        // Pass HttpClient instance reference
        $this->container->setHttpClient($this->httpClient);
        $this->service->setHttpClient($this->httpClient);
    }
442518
public function boot()
    {
        $router = $this->app['router'];

        $router->middlewareGroup('soda.web', [Drafting::class]);
        $router->middlewareGroup('soda.api', [Drafting::class]);

        $router->pushMiddlewareToGroup('web', TransferSession::class);
        $router->pushMiddlewareToGroup('web', DraftAlert::class);
        $router->pushMiddlewareToGroup('web', ToggleLocale::class);
        if (config('soda.cms.https')) {
            $router->pushMiddlewareToGroup('soda.web', ForceHttps::class);
        }

        $router->aliasMiddleware('soda.auth', Authenticate::class);
        $router->aliasMiddleware('soda.guest', RedirectIfAuthenticated::class);

        $router->aliasMiddleware('soda.role', HasRole::class);
        $router->aliasMiddleware('soda.permission', HasPermission::class);
        $router->aliasMiddleware('soda.ability', HasAbility::class);

        $middlewareGroups = $router->getMiddlewareGroups();

        if (isset($middlewareGroups['web'])) {
            if (($key = array_search('Illuminate\Session\Middleware\StartSession', $middlewareGroups['web'])) !== false) {
                $middlewareGroups['web'][$key] = SluggableSession::class;
                array_unshift($router->middlewarePriority, SluggableSession::class);
            }

            $router->middlewareGroup('soda.sluggable-web', $middlewareGroups['web']);
        }

        parent::boot();
    }
1127167
protected function bootFilters()
	{
		if (config('api.cors_enabled', true)) {
			$this->app['router']->before(function ($request) {
				if (Request::header('Origin') && $_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
					$response = Response::make(null, 204);
					Cors::attachHeaders($response);
					Cors::attachOriginHeader($response, Request::header('Origin'));
					return $response;
				}
			});
			
			$this->app['router']->after(function ($request, $response) {
				if (Request::header('Origin')) {
					Cors::attachHeaders($response);
					Cors::attachOriginHeader($response, Request::header('Origin'));
				}
			});
		}
		
		$this->app['router']->filter('protect', function ($route, $request) {
			Api::protect();
		});
		
		$this->app['router']->filter('checkscope', function ($route, $request, $scope = '') {
			// B/c Laravel uses : as a special character already.
			$scope = str_replace('.', ':', $scope);
			
			Api::checkScope($scope);
		});
	}
491395
public function boot()
    {
        if (! defined("DT_STARTED")) {
            /** @deprecated  */
            define('DT_STARTED', true);
            /** @deprecated  */
            define('DT_Unique', 'Unique');
            /** @deprecated  */
            define('DT_UniqueNum', 'UniqueNumber');
            /** @deprecated  */
            define('DT_UniqueStr', 'UniqueString');
            /** @deprecated  */
            define('DT_Random', 'Random');
            /** @deprecated  */
            define('DT_RandomNum', 'RandomNumber');
            /** @deprecated  */
            define('DT_RandomStr', 'RandomString');
        }
    }
1268116
public function boot()
    {
        $path = \realpath(__DIR__.'/../');

        $this->addConfigComponent('orchestra/tenanti', 'orchestra/tenanti', "{$path}/config");

        if (! $this->hasPackageRepository()) {
            $this->bootUsingLaravel($path);
        }
    }
542206
public function boot()
    {
        foreach ($this->app->make('config')->get('tenancy.multi_site.router.patterns', []) as $name => $pattern) {
            Route::pattern($name, $pattern);
        }

        parent::boot();
    }
520928
def restart(name):
    '''
    
    '''
    if _service_is_upstart(name):
        cmd = 'restart {0}'.format(name)
    else:
        cmd = '/sbin/service {0} restart'.format(name)
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
231250
def _start_services(self, console_env):
        """"""
        self._ad.services.register('sl4a', sl4a_service.Sl4aService)
        console_env['s'] = self._ad.services.sl4a
        console_env['sl4a'] = self._ad.sl4a
        console_env['ed'] = self._ad.ed
998391
public function boot()
    {
        // Whether to add 'defer' to enqueued scripts.
        if (Config::get('theme.defer_scripts')) {
            $this->add_filter('script_loader_tag', 'defer_scripts', 10, 2);
        }

        // Whether to remove asset version strings.
        if (Config::get('theme.remove_asset_versions')) {
            $this->add_filter('style_loader_src', 'remove_versions_from_assets', 15);
            $this->add_filter('script_loader_src', 'remove_versions_from_assets', 15);
        }
    }
497835
protected static function boot()
    {
        parent::boot();

        static::deleting(function ($model) {
            $model->roles()->detach();

            $model->permissions()->detach();
        });
    }
375714
public function boot()
    {
        if ($this->isLumen() === false) {
            $this->publishes([
                __DIR__ . '/../../config/hashids.php' => config_path('hashids.php'),
            ]);

            // Add 'Assets' facade alias
            AliasLoader::getInstance()->alias('Hashids', 'Torann\Hashids\Facade');
        }
    }
971832
public function boot()
    {
        $registryServiceName = 'service_provider_registry_'.$this->id;
        $this->container->set($registryServiceName, $this->getRegistry($this->container));
    }
888391
public function boot()
  {
    if (!is_dir(Remember::$tokensDir)) {
      mkdir(Remember::$tokensDir, 0777, true);
    }

    $this->hasTokens();
    $this->configure();
    $this->start();
  }
1334236
def aliases(self):
        
        return ['ubi{}:{}'.format(self.device.parent.sys_number, self.label),
                self.node]