本文整理汇总了PHP中Illuminate\Session\Store::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Store::get方法的具体用法?PHP Store::get怎么用?PHP Store::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Session\Store
的用法示例。
在下文中一共展示了Store::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUser
public function getUser()
{
if ($this->user == false) {
$this->user = $this->session->get("sharp_user");
}
return $this->user;
}
示例2: 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');
}
}
示例3: errors
/**
* @return MessageBag
*/
private function errors()
{
if (!isset($this->errors)) {
$this->errors = $this->sessionStore->get('errors', new MessageBag([]));
}
return $this->errors;
}
示例4: getURL
public function getURL($name)
{
if ($this->sessionManager->has($name = $this->getName($name))) {
return $this->sessionManager->get($name);
}
return false;
}
示例5: handle
/**
* 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;
}
示例6:
/**
* @param Store $session
* @param Collection $collection
* @param Repository $config
*/
function __construct(Store $session, Collection $collection, Repository $config)
{
// set configurable options
$this->session_key = $config->get('augstudios.alerts.session_key', 'alerts');
// initialize properties
$this->session = $session;
$this->prior = $this->session->get($this->session_key, clone $collection);
$this->current = clone $collection;
}
示例7: message
/**
* @param $message
* @param string $level
*/
public function message($message, $level = 'info')
{
$notification = new \stdClass();
$notification->message = $message;
$notification->level = $level;
$notifications = $this->session->get('flash_notifications', []);
array_push($notifications, $notification);
$this->session->flash('flash_notifications', $notifications);
}
示例8: getRecentAuthData
/**
* Allows you retrieve the most recent social provider
* authorized with.
*
* @return mixed
*/
public function getRecentAuthData()
{
$providers = $this->session->get('__sp_auth.p');
if (!$providers) {
return null;
}
return array_first($providers, function ($provider) {
return $provider === $this->session->get('__sp_auth.r');
});
}
示例9: doAgegate
/**
* Processes the date of birth submitted in the age gate form
*/
public function doAgegate()
{
$previousTooYoung = $this->session->get('laravel-avp.previous_too_young');
if ($previousTooYoung) {
return $this->{$redirector}->action('FWM\\LaravelAVP\\AVPController@agegate');
}
// Get the date of birth that the user submitted
$dob = $this->handler->processDataOfBirth();
return $this->validation->validate($dob);
}
示例10: isRequired
/**
* Check if the reCAPTCHA is required
*
* @return bool Returns true if the captcha is required
*/
public function isRequired()
{
if (!$this->config->get('larapress.settings.captcha.active')) {
return false;
}
$timer = $this->config->get('larapress.settings.captcha.timer');
if ($this->helpers->getCurrentTimeDifference($this->session->get('captcha.passed.time', 0), 'm') >= $timer) {
return true;
}
return false;
}
示例11: Collection
/**
* Create a new flash notifier instance.
*
* @param Store $session
* @param Application $app
*/
function __construct(Store $session, Application $app)
{
$this->session = $session;
$this->app = $app;
$this->messages = $this->session->pull('__messages', new Collection());
if ($this->session->has('errors')) {
$errors = $this->session->get('errors')->getBag('default')->getMessages();
foreach ($errors as $error) {
$this->add(['message' => current($error), 'type' => 'info', 'class' => 'warning'], false);
}
}
}
示例12: __construct
public function __construct(Store $session, Factory $view)
{
$this->session = $session;
$view->share('flash', $this);
if ($this->session->has($this->namespace)) {
$flashed = $this->session->get($this->namespace);
$this->message = $flashed['message'];
$this->title = $flashed['title'];
$this->type = $flashed['type'];
$this->exists = true;
}
}
示例13: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$containers = $this->session->get($this->key, []);
if (count($containers) > 0) {
foreach ($containers as $name => $messages) {
/** @var \Krucas\Notification\Message $message */
foreach ($messages as $message) {
$this->notification->container($name)->add($message->getType(), $message, false);
}
}
}
$this->session->forget($this->key);
return $next($request);
}
示例14: handle
/**
* Handle user logged in.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
*
* @return bool|null
*/
public function handle(Authenticatable $user)
{
$social = $this->session->get('authentication.social.oauth');
if (is_null($social)) {
return;
}
$model = User::where('provider', '=', $social['provider'])->where('uid', '=', $social['user']->getId())->first();
if (is_null($model)) {
return;
}
$model->setAttribute('user_id', $user->getAuthIdentifier());
$model->save();
return true;
}
示例15: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$containerNames = $this->session->get($this->sessionPrefix . 'containers', array());
$sessionVariables = $this->session->all();
foreach ($containerNames as $containerName) {
foreach ($sessionVariables as $sessionKey => $value) {
if (strpos($sessionKey, $this->sessionPrefix . $containerName) === 0 && is_string($value)) {
$jsonMessage = json_decode($value);
$this->notification->container($containerName)->add($jsonMessage->type, new Message($jsonMessage->type, $jsonMessage->message, false, $jsonMessage->format, $jsonMessage->alias, $jsonMessage->position), false);
}
}
}
return $next($request);
}