Beispiel #1
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->singleton('Illuminate\\Contracts\\Auth\\Guard', function () {
         $hasher = $this->app->make('Illuminate\\Contracts\\Hashing\\Hasher');
         $session = $this->app->make('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');
         $provider = new EloquentUserProvider($hasher, 'FluxBB\\Models\\User');
         $guard = new Guard($provider, $session);
         $guard->setCookieJar($this->app->make('Illuminate\\Contracts\\Cookie\\QueueingFactory'));
         $guard->setDispatcher($this->app->make('Illuminate\\Contracts\\Events\\Dispatcher'));
         $guard->setRequest($this->app->make('Symfony\\Component\\HttpFoundation\\Request'));
         return $guard;
     });
     if (Core::isInstalled()) {
         $this->app->extend('view', function ($view) {
             $view->share('user', $this->app->make('Illuminate\\Contracts\\Auth\\Guard')->user());
             return $view;
         });
     }
 }
Beispiel #2
0
 /**
  * Set the event dispatcher instance.
  *
  * @param \Illuminate\Contracts\Events\Dispatcher $events
  * @return void 
  * @static 
  */
 public static function setDispatcher($events)
 {
     \Illuminate\Auth\Guard::setDispatcher($events);
 }