/** * register the provider * * @return mixed */ public function register() { Config::set('database.tables.login', $this->login); Config::set('database.tables.select', $this->select); Config::set('database.tables.authentication', $this->role); Config::set('database.tables.table', $this->table); }
/** * register the provider */ public function register() { $session = new SessionManager(Config::get('stroge.session'), App::make('crypt')); $session->extend('cookie', function (array $configs = []) { $lifetime = Arr::get($configs, 'cookie.lifetime', 1800); $cookie = App::make('cookie'); return new CookieSessionHandler($cookie, $lifetime); }); $session->extend('database', function (array $configs = []) { $table = Arr::get($configs, 'database.table'); $base = App::make('database.base'); return new DatabaseSessionHandler($base, $table); }); $session->extend('file', function (array $configs = []) { $filesystem = Stroge::disk('local'); $path = Arr::get($configs, 'file.path', RESOURCE . 'sessions/'); return new FileSessionHandler($filesystem, $path); }); $session->extend('cache', function () { return App::make('cache'); }); $this->singleton('session', function () use($session) { return $session; }); $this->singleton('session.stroge', function () { $driver = Config::get('stroge.session.driver'); return App::make('session')->driver($driver); }); }
/** * * register the cache provider * */ public function register() { $this->singleton('cache', function () { $configs = Config::get('stroge.cache'); $driver = isset($configs['driver']) ? $configs['driver'] : 'file'; return (new Cache())->driver($driver, $configs); }); }
/** * register the provider * * @return mixed */ public function register() { $events = Config::get('event.events'); EventCollector::setListeners(array_merge($this->events, $events)); include APP . 'events.php'; }
/** * Silinecek verileri bu fonksiyon içinde ayarlarız * * @return mixed */ public function down() { $table = Config::get('billing.table_name'); Schema::drop($table); }
/** * @param int $page * @return \Anonym\Components\Database\Mode\Read */ public function page($page) { $this->page = $page; $limit = Config::get('database.pagination'); $limit = $limit['limit']; $baslangic = ($page - 1) * $limit; $bitis = $page * $limit; return $this->limit([$baslangic, $bitis]); }
/** * send the mail with config name and closure callback * * @param string $name * @param callable $callback * @return mixed * @throws DriverException * @throws DriverNotInstalledException */ public function send($name = '', callable $callback) { $configs = Config::get($name); $driver = $this->driver(isset($configs['driver']) ? $configs['driver'] : 'swift', $configs); return $callback($driver); }
/** * register the provider * * @return mixed */ public function register() { Config::set('database.tables.register', $this->register); }
/** * reset the password * * @param string $key * @param string $newPassword * @return bool */ protected function forgetResetPassword($key = '', $newPassword = '') { if ($information = $this->forgetKeyIsExists($key)) { $userid = $information->user_id; $table = Config::get('database.tables.table'); $user = Element::table($table); $findId = $user->find($userid); if (!$findId->rowCount()) { return false; } $update = $user->set(['password' => Crypt::encode($newPassword)])->update(); Element::table('forgets')->where('key', $key)->delete(); return $update ? true : false; } else { return false; } }
/** * work with config files * * @param string $name the name of config * @param mixed $set if it is not equal, these values will be set the config file * @return mixed */ function config($name = '', $set = null) { if ('' === $name) { return App::make('config'); } return null === $set ? Config::get($name) : Config::set($name, $set); }