/** * Bootstrap any application services. */ public function boot(Kernel $kernel) { $kernel->pushMiddleware(SetConfigRepository::class); if ($this->app->runningInConsole() === true) { $this->handlePublishes(); } }
/** * Add the Cors middleware to the router. * * @param Kernel $kernel */ public function boot(Request $request, Kernel $kernel) { $this->publishes([$this->configPath() => config_path('cors.php')]); $this->app['router']->middleware('cors', HandleCors::class); if ($request->isMethod('OPTIONS')) { $kernel->prependMiddleware(HandlePreflight::class); } }
public function boot(Kernel $kernel) { $this->publishes([__DIR__ . '/../config/tracy.php' => config_path('tracy.php')], 'config'); if ($this->isEnabled() === false) { return; } $kernel->pushMiddleware(AppendDebugbar::class); }
/** * Perform post-registration booting of services. * * @return void */ public function boot(\Illuminate\Routing\Router $router, \Illuminate\Contracts\Http\Kernel $kernel) { $this->loadViewsFrom(__DIR__ . '/resources/views', 'TaskManager'); $router->middleware('TaskManager', 'agoalofalife\\TaskManager\\Middleware\\TaskManager'); $kernel->prependMiddleware('agoalofalife\\TaskManager\\Middleware\\TaskManager'); $kernel->pushMiddleware('agoalofalife\\TaskManager\\Middleware\\TaskManager'); $this->publishes([__DIR__ . '/resources/assets/' => public_path('vendor/TaskManager')], 'public'); }
/** * Add the Cors middleware to the router. * * @param Kernel $kernel */ public function boot(Request $request, Kernel $kernel) { $this->publishes([$this->configPath() => config_path('cors.php')]); $this->app['router']->middleware('cors', 'Barryvdh\\Cors\\HandleCors'); if ($request->isMethod('OPTIONS')) { $kernel->pushMiddleware('Barryvdh\\Cors\\HandlePreflight'); } }
/** * Register route middleware. * * @param \Illuminate\Routing\Router $router * @param \Illuminate\Contracts\Http\Kernel $kernel * * @return void */ protected function registerRouteMiddleware(Router $router, Kernel $kernel) { foreach ((array) $this->middleware as $middleware) { $kernel->pushMiddleware($middleware); } foreach ((array) $this->routeMiddleware as $key => $middleware) { $router->middleware($key, $middleware); } }
/** * @param Router $router * @param Kernel|\Illuminate\Foundation\Http\Kernel $kernel */ public function boot(Router $router, Kernel $kernel) { $this->map($router); $this->kernel = $kernel; // The middleware is used to intercept every request with specific header // so that laravel can tell us, which route the request belongs to. $kernel->prependMiddleware(DetectRoute::class); $kernel->prependMiddleware(PreventRedirect::class); }
/** * Bootstrap the application events. * * @param Kernel $kernel */ public function boot(Kernel $kernel) { $this->loadViewsFrom(__DIR__ . '/../resources/views', 'shapeshifter'); $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'shapeshifter'); $this->mergeConfigFrom(__DIR__ . '/../resources/config/shapeshifter.php', 'shapeshifter'); $this->publishes([__DIR__ . '/../resources/config/shapeshifter.php' => config_path('shapeshifter.php'), __DIR__ . '/../resources/lang' => base_path('resources/lang/vendor/shapeshifter')], 'core'); $this->publishes([__DIR__ . '/../public' => public_path('packages/just/shapeshifter')], 'public'); $kernel->pushMiddleware(NotificationMiddleware::class); }
public function boot(Kernel $kernel) { $this->handlePublishes(); if ($this->isEnabled() === false) { return; } $this->registerExceptionHandler(); $this->registerDebugger(); $kernel->pushMiddleware(AppendDebugbar::class); }
/** * Bootstrap any application services. * * @return void */ public function boot(\Illuminate\Routing\Router $router, \Illuminate\Contracts\Http\Kernel $kernel) { $kernel->prependMiddleware(\Askedio\Laravel100PageSpeed\Http\Middleware\Minify::class); $kernel->pushMiddleware(\Askedio\Laravel100PageSpeed\Http\Middleware\Minify::class); $router->middleware('minify', \Askedio\Laravel100PageSpeed\Http\Middleware\Minify::class); if (!$this->app->routesAreCached()) { require __DIR__ . '/routes.php'; } $this->publishes([__DIR__ . '/config/minify.php' => config_path('minify.php')]); $this->mergeConfigFrom(__DIR__ . '/config/minify.php', 'minify'); }
public function boot(Kernel $kernel) { if ($this->isEnabled() === false) { return; } $this->mergeConfigFrom(__DIR__ . '/../config/tracy.php', 'tracy'); $this->publishes([__DIR__ . '/../config/tracy.php' => config_path('tracy.php')], 'config'); $this->registerExceptionHandler(); $this->registerDebugger(); $kernel->pushMiddleware(AppendDebugbar::class); }
/** * Bootstrap any application services. * * @return void */ public function boot(Kernel $kernel) { Blade::directive('cache', function ($expression) { return "<?php if(! app('JoeriAben\\BladeCache\\Tags')->open{$expression}): ?>"; }); Blade::directive('endcache', function () { return "<?php endif; echo app('JoeriAben\\BladeCache\\Tags')->close() ?>"; }); $this->publishes([__DIR__ . '/../config/bladecache.php' => $this->app->configPath() . '/' . 'bladecache.php'], 'config'); $kernel->pushMiddleware('JoeriAben\\BladeCache\\Middleware'); }
/** * Bootstrap any application services. * * @param Kernel $kernel */ public function boot(Kernel $kernel) { if ($this->app->isLocal()) { $kernel->pushMiddleware('Laracasts\\Matryoshka\\FlushViews'); } Blade::directive('cache', function ($expression) { return "<?php if (! app('Laracasts\\Matryoshka\\BladeDirective')->setUp{$expression}) : ?>"; }); Blade::directive('endcache', function () { return "<?php endif; echo app('Laracasts\\Matryoshka\\BladeDirective')->tearDown() ?>"; }); }
/** * Bootstrap any application services. * * @return void */ public function boot(Kernel $kernel) { if ($this->app->isLocal()) { $kernel->pushMiddleware('Fwartner\\Katching\\FlushViews'); } Blade::directive('cache', function ($expression) { return "<?php if (! app('Fwartner\\Katching\\Directive')->setup{$expression}) : ?>"; }); Blade::directive('endcache', function () { return "<?php endif; echo app('Fwartner\\Katching\\Directive')->teardown() ?>"; }); }
/** * Add the Cors middleware to the router. * @param Request $request * @param Kernel $kernel */ public function boot(Request $request, Kernel $kernel) { /** @var \Illuminate\Http\Request $request */ $request = $this->app['request']; $config = $this->getOptions($request); $this->app->bind('Asm89\\Stack\\CorsService', function () use($config) { return new CorsService($config); }); $this->app['router']->middleware('cors', 'Barryvdh\\Cors\\HandleCors'); if ($request->isMethod('OPTIONS')) { $kernel->pushMiddleware('Barryvdh\\Cors\\HandlePreflight'); } }
/** * boot. * * @method boot * * @param \Illuminate\Contracts\Http\Kernel $kernel */ public function boot(Kernel $kernel) { if ($this->app->runningInConsole() === true) { $this->publishes([__DIR__ . '/../config/tracy.php' => $this->app->configPath() . '/tracy.php'], 'config'); return; } if ($this->app['config']['tracy']['enabled'] === true) { $this->app->extend(ExceptionHandler::class, function ($exceptionHandler, $app) { return $app->make(Handler::class, ['exceptionHandler' => $exceptionHandler]); }); $kernel->prependMiddleware(Dispatch::class); $kernel->pushMiddleware(AppendDebugbar::class); } }
/** * Perform post-registration booting of services. * * @return void */ public function boot(Kernel $kernel, DispatcherContract $events, Router $router) { $this->mergeConfigFrom(__DIR__ . '/config/usermanager.php', 'kiwi.usermanager'); $this->loadViewsFrom(__DIR__ . '/resources/views', 'kiwi/usermanager'); $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'kiwi/usermanager'); $this->publishes([__DIR__ . '/resources/views' => base_path('resources/views/vendor/kiwi/usermanager'), __DIR__ . '/resources/lang' => base_path('resources/lang/vendor/kiwi/usermanager'), __DIR__ . '/config/usermanager.php' => config_path('kiwi/usermanager.php')]); // Set e-mail reset view Config::set('auth.password.email', 'kiwi/usermanager::emails.' . $this->app->getLocale() . '.reset'); // Add package routes $this->app->router->group(['namespace' => 'Kiwi\\UserManager\\Http\\Controllers'], function () { require __DIR__ . '/Http/routes.php'; }); /** * Register events */ $registeredEvents = Config::get('kiwi.usermanager.events'); foreach ($registeredEvents as $event => $listeners) { if (is_array($listeners)) { foreach ($listeners as $listener) { $events->listen($event, $listener); } } elseif (is_string($listeners)) { $events->listen($event, $listeners); } else { throw new UserManagerException('Invalid listeners for ' . $event . ' event (string or array required, ' . gettype($listeners) . ' provided)'); } } /* * Add password validator * Checks if $value matches current user's password */ Validator::extend('password', 'Kiwi\\UserManager\\Validators\\Password@validate', trans('kiwi/usermanager::validation.password')); /* * Init services */ $kernel->pushMiddleware('Kiwi\\UserManager\\Http\\Middleware\\UserManager'); /* * NoCaptcha config */ $noCaptcha = Config::get('kiwi.usermanager.services.nocaptcha'); if (!is_null($noCaptcha) && $noCaptcha) { $noCaptchaSecretKey = env('NOCAPTCHA_SECRET'); $noCaptchaSiteKey = env('NOCAPTCHA_SITEKEY'); if (strlen($noCaptchaSecretKey) == 0 || strlen($noCaptchaSiteKey) == 0) { throw new UserManagerException('In order to use NoCaptcha ReCaptcha service, please set your secret keys in your env file (NOCAPTCHA_SITEKEY, NOCAPTCHA_SECRET)'); } } }
/** * boot. * * @method boot * * @param \Illuminate\Contracts\Http\Kernel $kernel * @param \Illuminate\Contracts\View\Factory $view */ public function boot(Kernel $kernel, View $view) { if ($this->app->runningInConsole() === true) { $this->publishes([__DIR__ . '/../config/tracy.php' => $this->app->configPath() . '/tracy.php'], 'config'); return; } if ($this->app['config']['tracy']['enabled'] === true) { $this->app->extend(ExceptionHandler::class, function ($exceptionHandler, $app) { return $app->make(Handler::class, ['exceptionHandler' => $exceptionHandler]); }); $kernel->prependMiddleware(Dispatch::class); } $view->getEngineResolver()->resolve('blade')->getCompiler()->directive('bdump', function ($expression) { return "<?php \\Tracy\\Debugger::barDump({$expression}); ?>"; }); }
/** * Registers global middleware for the CMS API. * * @return $this */ protected function registerCmsApiGroupMiddleware() { $this->router->middlewareGroup($this->getConfiguredApiGroupName(), []); foreach ($this->getGlobalApiMiddleware() as $middleware) { // Don't add if the middleware is already globally enabled in the kernel if ($this->kernel->hasMiddleware($middleware)) { continue; } $this->router->pushMiddlewareToGroup($this->getConfiguredApiGroupName(), $middleware); } return $this; }
protected function addRequestMiddlewareToBeginning(Kernel $kernel) { /** @var \App\Http\Kernel $kernel */ $kernel->prependMiddleware('Develpr\\AlexaApp\\Http\\Middleware\\Request'); }
/** * @param Kernel $kernel */ public function boot(Kernel $kernel) { $kernel->pushMiddleware('BastienDonjon\\DomainLocalization\\DomainLocalizationMiddleware'); $this->publishes([__DIR__ . '/Config.php' => config_path('domain-localization.php')]); }
private function registerMiddleware(Kernel $kernel) { // add our middleware at the beginning, before CSRF checking $kernel->prependMiddleware(Middleware\VerifyDeployRequest::class); }
/** * Boot the Service. */ public function boot(\Illuminate\Contracts\Http\Kernel $kernel) { if ($this->app->environment() == 'local') { $kernel->prependMiddleware(\Clockwork\Support\Laravel\ClockworkMiddleware::class); } }
/** * Bootstrap the application events. * * @return void */ public function boot(Kernel $kernel) { $kernel->pushMiddleware('\\Amiya\\Setting\\Middleware\\SaveSettingsMiddleware'); }
/** * Add middlewares from this package. * * @param \Illuminate\Contracts\Http\Kernel $kernel */ protected function addMiddlewares($kernel) { foreach ($this->otherMiddlewares as $key => $value) { $kernel->pushMiddleware($value); } }
/** * Add the request middleware to the beginning of the kernel. * * @author Morten Rugaard <*****@*****.**> * * @param \Illuminate\Contracts\Http\Kernel $kernel * @return void */ protected function addRequestMiddlewareToBeginning(IlluminateContractKernel $kernel) { $kernel->prependMiddleware(NodesHttpMiddlewareRequest::class); }
/** * @param Kernel $kernel */ private function registerMiddlewares(Kernel $kernel) { foreach ($this->middleware as $middleware) { $kernel->pushMiddleware($middleware); } }
/** * Add the request middleware to the beggining of the kernel. * * @param \Illuminate\Contracts\Http\Kernel $kernel * * @return void */ protected function addRequestMiddlewareToBeginning(Kernel $kernel) { $kernel->prependMiddleware('Dingo\\Api\\Http\\Middleware\\Request'); }
/** * Add the request middleware to the beginning of the kernel. * * @param \Illuminate\Contracts\Http\Kernel $kernel * * @return void */ protected function addRequestMiddlewareToBeginning(Kernel $kernel) { $kernel->prependMiddleware(Request::class); }