/** * Create a new driver instance. * * @param string $driver * @return mixed */ protected function createDriver($driver) { $guard = parent::createDriver($driver); // When using the remember me functionality of the authentication services we // will need to be set the encryption instance of the guard, which allows // secure, encrypted cookie values to get generated for those cookies. $guard->setCookieJar($this->app['cookie']); $guard->setDispatcher($this->app['events']); return $guard->setRequest($this->app->refresh('request', $guard, 'setRequest')); }