php Illuminate-Session-Store类(方法)实例源码

下面列出了php Illuminate-Session-Store 类(方法)源码代码实例,从而了解它的用法。

作者:jaffle-b    项目:framewor   
/**
  * @param AccountManager $manager
  * @param Store $session
  * @return \Illuminate\Contracts\View\View
  * @throws \Exception
  */
 public function index(AccountManager $manager, Store $session)
 {
     $account = $manager->account();
     $contact = $account->contactInformation->first();
     $success = $session->get('success');
     return $this->theme->render('contact.' . $this->theme->setting('contactLayout'), ['contact' => $contact, 'success' => $success]);
 }

作者:hughgrig    项目:ching-sho   
/**
  * Should give the fallback string when old input is not present.
  */
 public function testOldInputOrWithoutOldInput()
 {
     $fieldName = $this->generator()->anyString();
     $this->sessionStore->shouldReceive('getOldInput')->andReturn([$fieldName => []]);
     $fallbackValue = $this->generator()->anyString();
     $this->assertSame($fallbackValue, $this->replyComposer->oldInputOr($fieldName, $fallbackValue));
 }

作者:jacksun10    项目:streams-platfor   
/**
  * Handle the event.
  */
 public function handle(Store $session)
 {
     /* @var MessageBag $errors */
     if ($errors = $session->get($this->builder->getOption('prefix') . 'errors')) {
         $this->builder->setFormErrors($errors);
     }
 }

作者:nWidar    项目:twitte   
public function __construct($config = [], SessionStore $session)
 {
     if (is_array($config['ttwitter::config'])) {
         $this->tconfig = $config['ttwitter::config'];
     } else {
         if (is_array($config['ttwitter'])) {
             $this->tconfig = $config['ttwitter'];
         } else {
             throw new Exception('No config found');
         }
     }
     $this->debug = isset($this->tconfig['debug']) && $this->tconfig['debug'] ? true : false;
     $this->parent_config = [];
     $this->parent_config['consumer_key'] = $this->tconfig['CONSUMER_KEY'];
     $this->parent_config['consumer_secret'] = $this->tconfig['CONSUMER_SECRET'];
     $this->parent_config['token'] = $this->tconfig['ACCESS_TOKEN'];
     $this->parent_config['secret'] = $this->tconfig['ACCESS_TOKEN_SECRET'];
     if ($session->has('access_token')) {
         $access_token = $session->get('access_token');
         if (is_array($access_token) && isset($access_token['oauth_token']) && isset($access_token['oauth_token_secret']) && !empty($access_token['oauth_token']) && !empty($access_token['oauth_token_secret'])) {
             $this->parent_config['token'] = $access_token['oauth_token'];
             $this->parent_config['secret'] = $access_token['oauth_token_secret'];
         }
     }
     $this->parent_config['use_ssl'] = $this->tconfig['USE_SSL'];
     $this->parent_config['user_agent'] = 'LTTW ' . parent::VERSION;
     $config = array_merge($this->parent_config, $this->tconfig);
     parent::__construct($this->parent_config);
 }

作者:hughgrig    项目:ching-sho   
/**
  * @return MessageBag
  */
 private function oldInput()
 {
     if (!isset($this->oldInput)) {
         $this->oldInput = new MessageBag((array) $this->sessionStore->getOldInput());
     }
     return $this->oldInput;
 }

作者:jacksun10    项目:streams-platfor   
/**
  * Handle the event.
  *
  * @param Store $session
  */
 public function handle(Store $session)
 {
     /* @var FieldType $field */
     foreach ($this->builder->getFormFields() as $field) {
         $session->flash($field->getFieldName(), $field->getPostValue());
     }
 }

作者:iyowork    项目:suppor   
/**
  * Store the messages in the current session.
  */
 public function flash()
 {
     if (static::$session) {
         static::$session->flash($this->getSessionKey(), $this);
     }
     return $this;
 }

作者:sharenjo    项目:cmsharenjo   
public function __construct(Store $session, $messages = array())
 {
     $this->session = $session;
     if ($session->has($this->session_key)) {
         $messages = array_merge_recursive($session->get($this->session_key), $messages);
     }
     parent::__construct($messages);
 }

作者:jaffle-b    项目:framewor   
/**
  * @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'));
 }

作者:ruys    项目:laravel4-for   
/**
  * Class constructor.
  *
  * @param Illuminate\Html\FormBuilder $builder
  * @param Illuminate\Http\Request     $request
  * @param Illuminate\Session\Store    $session
  */
 public function __construct(Builder $builder, Request $request, Session $session)
 {
     $this->builder = $builder;
     $this->request = $request;
     $this->fields = new FieldCollection();
     $this->fields->setNamespace($this->namespace);
     $this->fields->setBuilder($this->builder);
     $this->fields->setErrorBag($session->has('errors') ? $session->get('errors')->getBag($this->namespace) : new MessageBag());
 }

作者:elvio    项目:darkshar   
/**
  * Authenticate to a protected snippet.
  *
  * @param Url                       $url
  * @param \Illuminate\Http\Request  $request
  * @param \Illuminate\Session\Store $session
  * @return \Illuminate\Http\RedirectResponse
  */
 public function authenticate(Url $url, Request $request, Store $session)
 {
     if (!$url->authenticate($request->input('password'))) {
         flash()->warning('Wrong password');
         return redirect()->back();
     }
     $session->flash('urls_auth', true);
     return redirect()->route('urls.show', $url->slug->slug);
 }

作者:jarnsted    项目:forme   
/**
  * Class constructor
  *
  * @param \Illuminate\Html\HtmlBuilder      $html
  * @param \Illuminate\Routing\UrlGenerator  $url
  * @param \Illuminate\Session\Store         $session
  * @param \Illuminate\Config\Repository     $config
  */
 public function __construct(HtmlBuilder $html, UrlGenerator $url, Session $session, Config $config)
 {
     $this->url = $url;
     $this->html = $html;
     $this->csrfToken = $session->getToken();
     $this->config = $config;
     $this->loadConfig();
     $this->session = $session;
     $this->errors = $session->get('errors');
 }

作者:anlutr    项目:l4-cor   
protected function makeResponse(Request $request)
 {
     $message = $this->translator->get('c::auth.login-required');
     if ($request->ajax() || $request->isJson() || $request->wantsJson()) {
         return Response::json(['error' => $message], 403);
     } else {
         $url = $this->url->action('anlutro\\Core\\Web\\AuthController@login');
         $intended = $request->getMethod() == 'GET' ? $request->fullUrl() : ($request->header('referer') ?: '/');
         $this->session->put('url.intended', $intended);
         return $this->redirect->to($url)->with('error', $message);
     }
 }

作者:fastwebmedi    项目:laravel-av   
/**
  * Validate what is passed into the age gate
  *
  * @param array $data
  * @return $this|Validation|\Illuminate\Http\RedirectResponse
  */
 public function validate(array $data)
 {
     $this->validation = $this->validator->make($data, $this->getValidationRules(), $this->getValidationMessages());
     if ($this->validation->fails()) {
         $failed = $this->validation->failed();
         $validExceptTooYoung = array_get($failed, 'dob.Before');
         $canTryAgain = config('laravel-avp.can_try_again');
         $toRedirect = config('laravel-avp.redirect_on_error');
         $redirectURL = config('laravel-avp.redirect_url');
         if (substr($data['dob'], 0, 4) > date('Y')) {
             return redirect()->action('AVPController@agegate')->withErrors($this->validation->messages())->withInput();
         } else {
             if ($validExceptTooYoung && $toRedirect) {
                 return redirect($redirectURL);
             } else {
                 if ($validExceptTooYoung && !$canTryAgain) {
                     $this->session->put('laravel-avp.previous_too_young', true);
                 } else {
                     $this->session->keep('url.intended');
                 }
             }
         }
         return redirect()->action('AVPController@agegate')->withErrors($this->validation->messages())->withInput();
     }
     return $this->setCookie($data['remember']);
 }

作者:hugleste    项目:streams-platfor   
/**
  * 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');
     }
 }

作者:dvlp    项目:shar   
public function getUser()
 {
     if ($this->user == false) {
         $this->user = $this->session->get("sharp_user");
     }
     return $this->user;
 }

作者:jolupez    项目:wacta   
/**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->session->has('customer_id')) {
         return redirect()->to('admin');
     }
     return $next($request);
 }

作者:willish    项目:laravel5-flas   
/**
  * Setup the flash messsage data.
  *
  * @param string $message
  * @param string $title
  * @param string $level
  */
 protected function message($message, $title = '', $type = 'info')
 {
     $this->message = $message;
     $this->title = $title;
     $this->type = $type;
     $this->session->flash($this->namespace, (array) $this);
 }

作者:wegnermedi    项目:melo   
/**
  * 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;
 }

作者:paul-schuller    项目:laravel-googletagmanage   
/**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->session->has($this->sessionKey)) {
         $this->googleTagManager->set($this->session->get($this->sessionKey));
     }
     $response = $next($request);
     $this->session->flash($this->sessionKey, $this->googleTagManager->getFlashData());
     return $response;
 }


问题


面经


文章

微信
公众号

扫码关注公众号