Create an instance of the database driver.
@return \Kbwebs\MultiAuth\Guard
512874
public function createDatabaseDriver()
    {
        $provider = $this->createDatabaseProvider();
        return new Guard($provider, $this->app['session.store'], $this->name);
    }
218177
public function createCredentials()
    {
        $credentials = new Credentials();
        $credentials->setTransactor($this);
        $credentials->setCredentials(array(
            'providerId' => null,
            'providerGateId' => null,
            'providerGateKey' => null,
            'merchantId' => null,
            'merchantGateId' => null,
            'merchantGateKey' => null
        ));

        return $credentials;
    }
841149
private function conn()
    {
        if (!isset(self::$_db_handle[$this->db_config_name])) {
            $dbdriver = 'DB_' . Config::get('dbdriver');
            include_once __DIR__ . '/' . $dbdriver . '.php';

            $dbdriver = '\\ePHP\\Model\\' . $dbdriver;
            self::$_db_handle[$this->db_config_name] = $this->db = new $dbdriver($this->db_config_name);
        } else {
            $this->db = self::$_db_handle[$this->db_config_name];
        }

        return $this->db;
    }
351977
protected function createMemcacheDriver()
    {
        $serverArray    = $this->config['servers'];
        $persistent     = boolval($this->config['persistent']);
        $name           = trim($this->config['server_name']);
        $prefix         = trim($this->config['prefix']);
        $expireTime     = intval($this->config['lifetime']);

        if ($persistent && (strlen($name) > 0)) {
            $memcached  = new Memcached($name);
        } else {
            $memcached  = new Memcached();
        }

        if (!sizeof($memcached->getServerList())) {
            $memcached->addServers($serverArray);
        }

        $store = new MemcachedStore($memcached, $prefix);
        return new CacheSessionHandler($store, $expireTime);
    }
1183745
protected function createSesDriver()
    {
        $config = array_merge($this->app['config']->get('services.ses', []), [
            'version' => 'latest', 'service' => 'email',
        ]);

        return new SesTransport(
            new SesClient($this->addSesCredentials($config)),
            $config['options'] ?? []
        );
    }
701581
private function createConfigurationDriver()
    {
        $reflection = new \ReflectionClass($this->driverClass());

        /** @var ConfigurationInterface $config */
        $config = $reflection->hasMethod('__construct')
            ? $reflection->newInstanceArgs([$this->file])
            : $reflection->newInstance();
        return $config;
    }
83107
protected function createDatabaseDriver()
    {
        $connection = $this->getDatabaseConnection();
        $connection->getReadPdo();
        $table = $this->app['config']['session.table'];
        return $this->buildSession(new DatabaseSessionHandler($connection, $table, $this->app));

    }
844991
public function create()
    {
        $instance = self::createBraintreeGateway($this);
        $this->setId($instance->getId());
        return $instance;
    }
1006616
protected function create()
    {
        $this->user = app(\SuperV\Platform\Domains\Auth\Contracts\User::class)->create([
            'name'    => $this->request['name'],
            'email'    => $this->request['email'],
            'password' => bcrypt($this->request['password']),
        ]);

        return $this;
    }
787450
protected function create()
    {
        // if user_id and license_key are set then use the web service
        if (array_get($this->config, 'user_id', false)) {
            return $this->createWebClient();
        }

        // if database file is set then use database service
        if (array_get($this->config, 'database', false)) {
            return $this->createDatabase();
        }

        throw new InvalidCredentialsException();
    }
1138204
protected function createPlivoDriver()
    {
        $config = $this->app['config']->get('sms.plivo', []);

        $provider = new PlivoSMS(
            $config['auth_id'],
            $config['auth_token']
        );

        return $provider;
    }
664052
protected function createClient()
    {
        $client = new MultiCurl();
        $client->setVerifyPeer(false);

        $this->serviceClient = new Browser($client);

        return $this;
    }
706816
public function factory()
    {
        $method = $class = null;
        $class = __NAMESPACE__.'\\'.$this->drivers[$this->config['driver']];

        $name = $this->getName();
        if ($name != 'cygnite-session' && !is_null($this->cacheLimiter())) {
            $session = new $class($name, $this->cacheLimiter(), $this);
        } else {
            $session = new $class($this->name, null, $this);
        }

        return $session;
    }
344444
protected function createMemcachedDriver()
    {
        $servers = $this->app['config']['cache.memcached'];

        $memcached = $this->app['memcached.connector']->connect($servers);

        return $this->repository(new MemcachedStore($memcached, $this->getPrefix()));
    }
373150
public function makeInstance()
    {
        $class = $this->getVersionedRedisSentinelManagerClass();
        $config = $this->config->get('database.redis-sentinel', [ ]);
        $driver = Arr::pull($config, 'client', 'predis');

        // Laravel 5.7 introduced the app as the first parameter:
        if ($this->appVersionLessThan('5.7')) {
            return new RedisSentinelManager(new $class($driver, $config));
        }

        return new RedisSentinelManager(new $class($this->app, $driver, $config));

    }
659767
public static function instance() {
        if (is_null(self::$_instance)) {
            if (Config::config()['user']['database']['enabled']) {
                self::$_instance = new Database();
            }
            else {
                self::$_instance = new Database();
            }
        }

        return self::$_instance;
    }
73801
public function viaRequest($driver, callable $callback)
    {
        return $this->extend($driver, function () use ($callback) {
            $guard = new RequestGuard($callback, $this->app['request'], $this->createUserProvider());

            $this->app->refresh('request', $guard, 'setRequest');

            return $guard;
        });
    }