Example #1
0
 public function getWardrobeAuth()
 {
     $provider = $this->createEloquentProvider();
     $guard = new Guard($provider, App::make('session.store'), App::make('request'));
     $guard->setCookieJar(App::make('cookie'));
     return $guard;
 }
Example #2
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;
         });
     }
 }
Example #3
0
 /**
  * Set the cookie creator instance used by the guard.
  *
  * @param \Illuminate\Contracts\Cookie\QueueingFactory $cookie
  * @return void 
  * @static 
  */
 public static function setCookieJar($cookie)
 {
     \Illuminate\Auth\Guard::setCookieJar($cookie);
 }