/** * Remove item of the cart. * * @param $id * @return \Illuminate\Http\RedirectResponse */ public function destroy($id) { $cart = $this->getCart(); $cart->remove($id); $this->session->set('cart', $cart); return redirect()->route('cart'); }
/** * @return array */ public function processDataOfBirth() { // Get the date of birth that the user submitted $dob = null; if ($this->request->has('dob')) { // field name is dob when using input type date $dob = $this->request->get('dob'); } elseif ($this->request->has('dob_year') && $this->request->has('dob_month') && $this->request->has('dob_day')) { // field name has _year, _month and _day components if input type select $dob = $this->request->get('dob_year') . '-' . $this->request->get('dob_month') . '-' . $this->request->get('dob_day'); } $remember_me = false; if ($this->request->get('remember_me') == "on") { $this->session->set('remembered_day', $this->request->get('dob_day')); $this->session->set('remembered_month', $this->request->get('dob_month')); $this->session->set('remembered_year', $this->request->get('dob_year')); $this->session->set('remember_me', "on"); $remember_me = true; } else { $this->session->remove('remembered_day'); $this->session->remove('remembered_month'); $this->session->remove('remembered_year'); $this->session->remove('remember_me'); } // return in an array for validator return ['dob' => $dob, 'remember' => $remember_me]; }
/** * Handle the event. */ public function handle() { if (!$this->config->get('app.debug') && !$this->session->get(__CLASS__ . 'warned') && $this->request->path() == 'admin/dashboard' && $this->modules->get('anomaly.module.installer')) { $this->session->set(__CLASS__ . 'warned', true); $this->messages->error('streams::message.delete_installer'); } }
/** * This is what happens, wenn the detection passes * * @param $lookup * * @return mixed */ protected function handleDetectionComplete($lookup) { debugger()->info('Language detected: ' . $this->detected->slug); Cookie::queue($this->keys['cookie'], $this->detected->slug); $this->session->set($this->keys['session'], $this->detected->slug); $this->config->set('app.locale', $this->detected->slug); return $this->detected; }
public function login($login, $password) { if ($login == $this->config->get("sharp.auth_user") && $password == $this->config->get("sharp.auth_pwd")) { $this->session->set("sharp_user", $login); return $login; } $this->logout(); return false; }
/** * Merge a message onto the session. * * @param $type * @param $message */ protected function merge($type, $message) { $messages = $this->session->get($type, []); if (is_array($message)) { $messages = array_merge($messages, $message); } if (is_string($message)) { array_push($messages, $message); } $messages = array_unique($messages); $this->session->set($type, $messages); }
/** * Retrieve a user by the given credentials. * * @param array $credentials * @return \Illuminate\Auth\UserInterface|null */ public function retrieveByCredentials(array $credentials) { $username = $credentials[$this->params['identifier']]; $imap = @\imap_open($this->params['datasource'], $username, $credentials['password']); if (false !== $imap) { $credentials['id'] = $username; $user = new $this->model($credentials); $this->session->set('user.current', $user); return $user; } return null; }
public function getModuleSettings(Module $currentModule) { $this->assetPipeline->requireJs('selectize.js'); $this->assetPipeline->requireCss('selectize.css'); $this->assetPipeline->requireCss('selectize-default.css'); $this->session->set('module', $currentModule->getLowerName()); $modulesWithSettings = $this->setting->moduleSettings($this->module->enabled()); $translatableSettings = $this->setting->translatableModuleSettings($currentModule->getLowerName()); $plainSettings = $this->setting->plainModuleSettings($currentModule->getLowerName()); $dbSettings = $this->setting->savedModuleSettings($currentModule->getLowerName()); return view('setting::admin.module-settings', compact('currentModule', 'translatableSettings', 'plainSettings', 'dbSettings', 'modulesWithSettings')); }
public function authorize() { $authorizationUrl = $this->provider->getAuthorizationUrl(); $this->session->set($this->getSessionStateName(), $this->provider->getState()); $this->session->reflash(); return Redirect::to($authorizationUrl); }
/** * @param Store $session * @param Request $request * @param AccountManager $accounts * @return \Illuminate\Http\RedirectResponse */ public function locale(Store $session, Request $request, AccountManager $accounts) { $account = $accounts->account(); if ($request->has('locale') && $this->is_account_locale($account, $request->get('locale'))) { $session->set('locale', $request->get('locale')); return redirect()->to('/' . $request->get('locale')); } return redirect()->to(store_route('store.home')); }
/** * Ensure the basket is stored with current user_id and noted in the * session. */ public function saveBasket() { if ($this->guard->user() instanceof User && $this->guard->user()->getAuthIdentifier()) { $this->basket->user_id = $this->guard->user()->getAuthIdentifier(); } if (!$this->basket->deleted_at) { $this->basket->save(); } $this->session->set(self::SESSION_BASKET, $this->basket->id); }
/** * @param GatewayInterface $gateway * @param Store $session * @param Dispatcher $dispatcher * @return mixed * @throws TransactionFailedException */ public function handle(GatewayInterface $gateway, Store $session, Dispatcher $dispatcher) { $session->set('params', $this->details()); $response = $gateway->purchase($this->details())->send(); if ($response->isRedirect()) { // redirect to offsite payment gateway $dispatcher->fire(new TransactionRedirect($response->getMessage())); return $response->getRedirectUrl(); } else { $dispatcher->fire(new TransactionFailed($response->getMessage(), $response->getTransactionReference())); throw new TransactionFailedException($response->getMessage()); } }
/** * @param array $config * @param array $databaseConfig * * @return array * @throws InstallException */ public function install(array $config, array $databaseConfig) { if (isset($config['password_generate'])) { $config['password_field'] = str_random(); } date_default_timezone_set($config['timezone']); $this->session->set(static::POST_DATA_KEY, $config); $this->session->set(static::POST_DATABASE_KEY, $databaseConfig); $this->validation = $this->checkPostData($config); $databaseConfig = $this->configDBConnection($databaseConfig, 'driver', 'database'); $this->connection = $this->createDBConnection($databaseConfig); foreach ($databaseConfig as $key => $value) { $config['db_' . $key] = $value; } $this->createEnvironmentFile($config); $this->databaseDrop(); $this->initModules(); $this->databaseMigrate(); $this->databaseSeed(); $this->createAdmin($config); return $config; }
/** * Clear all the messages from the session. * Useful once the messages has been rendered. */ public function clean() { $this->session->set($this->key, null); }
function it_can_put_items_in_the_store_on_a_specific_key(Store $store) { $notifications = []; $store->set('my-key.new', $notifications)->shouldBeCalled(); $this->put('my-key.new', $notifications); }
/** * @param $step */ protected function step($step) { $this->session->set('cocona.installer.step', $step); }
/** * Save network volumes config. * * @param array $volumes volumes config * * @return void * @author Dmitry (dio) Levashov */ protected function saveNetVolumes(array $volumes) { $this->session->set(static::SESSION_NET_VOLUMES, $volumes); }
/** * {@inheritdoc} */ public function set($key, $data) { $this->store->set($key, $data); return $this; }
/** * Save current query parameters in session */ public function save() { $this->session->set($this->getSessionVarName(), $this->request->query()); }
function it_stores_an_orderId(Store $session) { $session->set($this->sessionParameterName, $this->testOrderId)->shouldBeCalled(); $this->setCurrentOrderId($this->testOrderId); }
/** * @param string $key * @param array $notifications * @return void */ public function put($key, array $notifications) { $this->store->set($key, $notifications); }
/** * Save location data in the session. * * @return void */ function saveLocation() { $this->session->set('geoip-location', $this->location); }
/** * @param Store $session * @param Request $request */ public function handle(Store $session, Request $request) { $session->set('table::' . $request->url(), $request->getQueryString()); }
/** * Set the current order id. * * @param $orderId */ public function setCurrentOrderId($orderId) { $this->session->set($this->sessionVariableName, $orderId); }
/** * Update the stored data. * * @return void */ protected function _updateStore() { $this->session->set($this->getStoreKey(), ['page' => $this->page ?: null, 'perPage' => $this->perPage ?: null, 'pageName' => $this->pageName, 'perPageName' => $this->perPageName, 'queries' => $this->queries ?: []]); }
/** * Clear the collection and return all the alerts. * * @return array */ public function all() { $all = $this->prepareAndGet()->all(); $this->session->set('chromabits.alerts', new Collection()); return $all; }
/** * Adds a value to the session using the lock's $sessionKey property * as a prefix. * * @param string $key * @param mixed $value * @return codenamegary\Lock\Lock */ protected function putSession($key, $value) { $this->session->set($this->sessionKey . '.' . $key, $value); return $this; }
protected function putErrorInSession($messages) { $errors = new MessageBag($messages); $this->session->set('errors', $errors); }
/** * Sets an attribute. * * @param string $name * @param mixed $value * @static */ public static function set($name, $value) { return \Illuminate\Session\Store::set($name, $value); }
/** * Recent / Providers * @param $provider * @param $data */ public function setAuthData($provider, $data) { $this->session->set('__sp_auth.r', $provider); $this->session->set('__sp_auth.p.' . $provider, array_merge(['provider' => $provider], $data)); $this->session->save(); }