Vsch\TranslationManager\ManagerServiceProvider::boot PHP Méthode

boot() public méthode

Bootstrap the application events.
public boot ( Router $router ) : void
$router Illuminate\Routing\Router
Résultat void
    public function boot(Router $router)
    {
        $resources = __DIR__ . '/../resources/';
        $this->loadViewsFrom($resources . 'views', self::PACKAGE);
        $this->loadTranslationsFrom($resources . 'lang', self::PACKAGE);
        $this->publishes([$resources . 'views' => base_path('resources/views/vendor/' . self::PACKAGE)], 'views');
        $this->publishes([$resources . 'lang' => base_path('resources/lang/vendor/' . self::PACKAGE)], 'lang');
        $this->publishes([__DIR__ . '/../public' => public_path('vendor/' . self::PACKAGE)], 'public');
        $migrationPath = __DIR__ . '/../database/migrations';
        $this->publishes([$migrationPath => base_path('database/migrations')], 'migrations');
        $config = $this->app['config']->get(self::PACKAGE . '.route', []);
        $config['namespace'] = 'Vsch\\TranslationManager';
        //$router->group($config, function ($router) {
        //    $router->get('view/{group}', 'Controller@getView');
        //    $router->controller('/', 'Controller');
        //});
        // Register Middleware so we can save our cached translations
        $router->pushMiddlewareToGroup('web', 'Vsch\\TranslationManager\\RouteAfterMiddleware');
    }