Ejemplo n.º 1
0
 /**
  * Register the AccessHandler implementation into the IoC Container.
  * This package provides a BasicAccessHandler.
  *
  * @return \Styde\Html\Access\AccessHandler
  */
 protected function registerAccessHandler()
 {
     $this->app[AccessHandler::class] = $this->app->share(function ($app) {
         $guard = $app['config']->get('html.guard', null);
         $handler = new BasicAccessHandler($app['auth']->guard($guard));
         $gate = $app->make(Gate::class);
         if ($gate) {
             $handler->setGate($gate);
         }
         return $handler;
     });
 }
Ejemplo n.º 2
0
 /**
  * Register the AccessHandler implementation into the IoC Container.
  * This package provides a BasicAccessHandler.
  *
  * @return \Styde\Html\Access\AccessHandler
  */
 protected function registerAccessHandler()
 {
     $this->app[AccessHandler::class] = $this->app->share(function ($app) {
         $handler = new BasicAccessHandler($app->make('auth')->driver());
         $gate = $app->make(Gate::class);
         if ($gate) {
             $handler->setGate($gate);
         }
         return $handler;
     });
 }