当前位置: 首页>>代码示例>>PHP>>正文


PHP Store::set方法代码示例

本文整理汇总了PHP中Illuminate\Session\Store::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Store::set方法的具体用法?PHP Store::set怎么用?PHP Store::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Session\Store的用法示例。


在下文中一共展示了Store::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: destroy

 /**
  * 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');
 }
开发者ID:JimiOhrid,项目名称:shopStore,代码行数:13,代码来源:CartController.php

示例2: processDataOfBirth

 /**
  * @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];
 }
开发者ID:fastwebmedia,项目名称:laravel-avp,代码行数:30,代码来源:RequestHandler.php

示例3: handle

 /**
  * 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');
     }
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:10,代码来源:CheckIfInstallerExists.php

示例4: handleDetectionComplete

 /**
  * 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;
 }
开发者ID:wegnermedia,项目名称:melon,代码行数:15,代码来源:CurrentLanguageDetector.php

示例5: login

 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;
 }
开发者ID:dvlpp,项目名称:sharp,代码行数:9,代码来源:SharpAuth.php

示例6: merge

 /**
  * 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);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:18,代码来源:MessageBag.php

示例7: retrieveByCredentials

 /**
  * 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;
 }
开发者ID:ronaldcastillo,项目名称:imap-authentication,代码行数:18,代码来源:ImapUserProvider.php

示例8: getModuleSettings

 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'));
 }
开发者ID:Houbsi,项目名称:Setting,代码行数:12,代码来源:SettingController.php

示例9: authorize

 public function authorize()
 {
     $authorizationUrl = $this->provider->getAuthorizationUrl();
     $this->session->set($this->getSessionStateName(), $this->provider->getState());
     $this->session->reflash();
     return Redirect::to($authorizationUrl);
 }
开发者ID:exolnet,项目名称:laravel-oauth-provider,代码行数:7,代码来源:OAuthService.php

示例10: locale

 /**
  * @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'));
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:15,代码来源:SystemController.php

示例11: saveBasket

 /**
  * 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);
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:14,代码来源:Clerk.php

示例12: handle

 /**
  * @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());
     }
 }
开发者ID:amonger,项目名称:laravel-payment-commands,代码行数:20,代码来源:MakePayment.php

示例13: install

 /**
  * @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;
 }
开发者ID:KodiComponents,项目名称:module-installer,代码行数:29,代码来源:Installer.php

示例14: clean

 /**
  * Clear all the messages from the session.
  * Useful once the messages has been rendered.
  */
 public function clean()
 {
     $this->session->set($this->key, null);
 }
开发者ID:mcarral,项目名称:html,代码行数:8,代码来源:SessionHandler.php

示例15:

 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);
 }
开发者ID:rojtjo,项目名称:notifier-laravel,代码行数:6,代码来源:SessionStoreSpec.php


注:本文中的Illuminate\Session\Store::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。