コード例 #1
0
 /**
  * Bootstrap any application services.
  */
 public function boot(Kernel $kernel)
 {
     $kernel->pushMiddleware(SetConfigRepository::class);
     if ($this->app->runningInConsole() === true) {
         $this->handlePublishes();
     }
 }
コード例 #2
0
 /**
  * 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);
     }
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 /**
  * 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');
 }
コード例 #5
0
 /**
  * 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');
     }
 }
コード例 #6
0
 /**
  * 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);
     }
 }
コード例 #7
0
 /**
  * @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);
 }
コード例 #8
0
 /**
  * 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);
 }
コード例 #9
0
 public function boot(Kernel $kernel)
 {
     $this->handlePublishes();
     if ($this->isEnabled() === false) {
         return;
     }
     $this->registerExceptionHandler();
     $this->registerDebugger();
     $kernel->pushMiddleware(AppendDebugbar::class);
 }
コード例 #10
0
 /**
  * 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');
 }
コード例 #11
0
 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);
 }
コード例 #12
0
 /**
  * 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');
 }
コード例 #13
0
 /**
  * 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() ?>";
     });
 }
コード例 #14
0
 /**
  * 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() ?>";
     });
 }
コード例 #15
0
 /**
  * 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');
     }
 }
コード例 #16
0
 /**
  * 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);
     }
 }
コード例 #17
0
 /**
  * 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)');
         }
     }
 }
コード例 #18
0
 /**
  * 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}); ?>";
     });
 }
コード例 #19
0
 /**
  * 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;
 }
コード例 #20
0
 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')]);
 }
コード例 #22
0
 private function registerMiddleware(Kernel $kernel)
 {
     // add our middleware at the beginning, before CSRF checking
     $kernel->prependMiddleware(Middleware\VerifyDeployRequest::class);
 }
コード例 #23
0
 /**
  * Boot the Service.
  */
 public function boot(\Illuminate\Contracts\Http\Kernel $kernel)
 {
     if ($this->app->environment() == 'local') {
         $kernel->prependMiddleware(\Clockwork\Support\Laravel\ClockworkMiddleware::class);
     }
 }
コード例 #24
0
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot(Kernel $kernel)
 {
     $kernel->pushMiddleware('\\Amiya\\Setting\\Middleware\\SaveSettingsMiddleware');
 }
コード例 #25
0
 /**
  * Add middlewares from this package.
  *
  * @param \Illuminate\Contracts\Http\Kernel $kernel
  */
 protected function addMiddlewares($kernel)
 {
     foreach ($this->otherMiddlewares as $key => $value) {
         $kernel->pushMiddleware($value);
     }
 }
コード例 #26
0
 /**
  * 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);
 }
コード例 #27
0
 /**
  * @param Kernel $kernel
  */
 private function registerMiddlewares(Kernel $kernel)
 {
     foreach ($this->middleware as $middleware) {
         $kernel->pushMiddleware($middleware);
     }
 }
コード例 #28
0
 /**
  * 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');
 }
コード例 #29
0
ファイル: LaravelServiceProvider.php プロジェクト: dingo/api
 /**
  * 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);
 }