/** * Run the database seeds. * * @return void */ public function run() { $conf = \Config::get('couch'); $user = $conf['username']; $pass = $conf['password']; $host = $conf['hostname']; $port = $conf['port']; $login = $user ? "{$user}:{$pass}@" : ""; $guz = new \App\Services\CouchService(['base_uri' => "http://{$login}{$host}:{$port}/", 'timeout' => 1800.0]); $guz->setDb('games'); $this->couchsag = $guz; $this->initDoc(); }
/** * Register the application services. * * @return void */ public function register() { $this->app->singleton('App\\Services\\CouchService', function () { $conf = $this->app->config['couch']; $user = $conf['username']; $pass = $conf['password']; $host = $conf['hostname']; $port = $conf['port']; $login = $user ? "{$user}:{$pass}@" : ""; $guz = new \App\Services\CouchService(['base_uri' => "http://{$login}{$host}:{$port}/", 'timeout' => 1800.0]); $guz->setDb('rest'); return $guz; }); }