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


PHP Store::forget方法代码示例

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


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

示例1: __construct

 /**
  * Create a new flash notifier instance.
  *
  * @param Store $session
  */
 public function __construct(Store $session)
 {
     if ($session->has('flash_notification.messages')) {
         $session->forget('flash_notification.messages');
     }
     if ($session->has('flash_notification.important')) {
         $session->forget('flash_notification.important');
     }
     $this->session = $session;
 }
开发者ID:tshafer,项目名称:laravel-flash,代码行数:15,代码来源:FlashNotifier.php

示例2: 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);
 }
开发者ID:areyi,项目名称:notification,代码行数:21,代码来源:NotificationMiddleware.php

示例3: __construct

 /**
  * The constructor
  *
  * @param HtmlBuilder  $html
  * @param UrlGenerator $url
  * @param Session      $session
  */
 public function __construct(HtmlBuilder $html, UrlGenerator $url, Session $session)
 {
     parent::__construct($html, $url, $session->getToken());
     $this->session = $session;
     $this->requiredFields = [];
     $this->errorFields = [];
     if ($this->session->has('formhelper-required-fields')) {
         $this->requiredFields = $this->session->get('formhelper-required-fields');
         $this->session->forget('formhelper-required-fields');
     }
     if ($this->session->has('formhelper-error-fields')) {
         $this->errorFields = $this->session->get('formhelper-error-fields');
         $this->session->forget('formhelper-error-fields');
     }
 }
开发者ID:artisaninweb,项目名称:laravel-formvalidation-helper,代码行数:22,代码来源:FormBuilder.php

示例4: retrieve

 /**
  * Retrieve Message instance from Session, the data should be in
  * serialize, so we need to unserialize it first.
  *
  * @return self
  */
 public function retrieve()
 {
     $messages = null;
     if (!isset($this->instance)) {
         $this->instance = new static();
         $this->instance->setSessionStore($this->session);
         if ($this->session->has('message')) {
             $messages = @unserialize($this->session->get('message', ''));
         }
         $this->session->forget('message');
         if (is_array($messages)) {
             $this->instance->merge($messages);
         }
     }
     return $this->instance;
 }
开发者ID:FUEL-dev-co,项目名称:boilerplate,代码行数:22,代码来源:Messages.php

示例5: publish

 /**
  * Publish process.
  *
  * @param  \Orchestra\Contracts\Foundation\Listener\AssetPublishing  $listener
  * @param  array  $input
  *
  * @return mixed
  */
 public function publish(Listener $listener, array $input)
 {
     $queues = $this->publisher->queued();
     // Make an attempt to connect to service first before
     try {
         $this->publisher->connect($input);
     } catch (ServerException $e) {
         $this->session->forget('orchestra.ftp');
         return $listener->publishingHasFailed(['error' => $e->getMessage()]);
     }
     $this->session->put('orchestra.ftp', $input);
     if ($this->publisher->connected() && !empty($queues)) {
         $this->publisher->execute();
     }
     return $listener->publishingHasSucceed();
 }
开发者ID:stevebauman,项目名称:foundation,代码行数:24,代码来源:AssetPublisher.php

示例6: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (config('misc.session_timeout_status')) {
         $isLoggedIn = $request->path() != '/logout';
         if (!session('lastActivityTime')) {
             $this->session->put('lastActivityTime', time());
         } elseif (time() - $this->session->get('lastActivityTime') > $this->timeout) {
             $this->session->forget('lastActivityTime');
             $cookie = cookie('intend', $isLoggedIn ? url()->current() : 'admin/dashboard');
             $email = $request->user()->email;
             access()->logout();
             return redirect()->route('frontend.auth.login')->withFlashWarning(trans('strings.backend.general.timeout') . $this->timeout / 60 . trans('strings.backend.general.minutes'))->withInput(compact('email'))->withCookie($cookie);
         }
         $isLoggedIn ? $this->session->put('lastActivityTime', time()) : $this->session->forget('lastActivityTime');
     }
     return $next($request);
 }
开发者ID:rappasoft,项目名称:laravel-5-boilerplate,代码行数:24,代码来源:SessionTimeout.php

示例7: flush

 /**
  * Flush the messages.
  *
  * @return $this
  */
 public function flush()
 {
     $this->session->forget('info');
     $this->session->forget('error');
     $this->session->forget('success');
     $this->session->forget('warning');
     return $this;
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:13,代码来源:MessageBag.php

示例8: all

 /**
  * Retrieve Message instance from Session, the data should be in
  * serialize, so we need to unserialize it first.
  *
  * @return Messages
  */
 public function all($format = null, $display = false)
 {
     $format = $this->checkFormat($format);
     $messages = null;
     if (!isset($this->instance)) {
         $this->instance = new static();
         $this->instance->setSessionStore($this->session);
         if ($this->session->has('message')) {
             $messages = @unserialize($this->session->get('message', ''));
         }
         $this->session->forget('message');
         if (is_array($messages)) {
             $this->instance->merge($messages);
         }
     }
     $all = array();
     foreach ($this->instance->messages as $key => $messages) {
         $all = array_merge($all, $this->transform($messages, $format, $key));
     }
     if (!$display) {
         return $all;
     }
     echo implode("\n", $all);
 }
开发者ID:fluentkit,项目名称:messages,代码行数:30,代码来源:Messages.php

示例9: forget

 /**
  * {@inheritdoc}
  */
 public function forget($index)
 {
     $this->session->forget($index);
 }
开发者ID:xaamin,项目名称:session,代码行数:7,代码来源:Session.php

示例10: forget

 /**
  * Remove a value from the session.
  *
  * @param  string $name
  * @return mixed
  */
 public function forget($name)
 {
     return $this->session->forget($name);
 }
开发者ID:michaeljennings,项目名称:carpenter,代码行数:10,代码来源:Illuminate.php

示例11: logout

 public function logout()
 {
     $this->session->forget("sharp_user");
 }
开发者ID:dvlpp,项目名称:sharp,代码行数:4,代码来源:SharpAuth.php

示例12: clearAllAuthorizationStates

 /**
  * @return TokenStorageInterface
  */
 public function clearAllAuthorizationStates()
 {
     $this->session->forget($this->stateVariableName);
     // allow chaining
     return $this;
 }
开发者ID:Superbalist,项目名称:laravel-lusitanian-oauth-session-store,代码行数:9,代码来源:LaravelTokenSessionStore.php

示例13: clear

 /**
  * Clear the stored filter data.
  *
  * @return void
  */
 public function clear()
 {
     $this->session->forget($this->getStoreKey());
 }
开发者ID:artissant,项目名称:stock,代码行数:9,代码来源:Filter.php

示例14: forget

 /**
  * {@inheritDoc}
  */
 public function forget()
 {
     $this->session->forget($this->key);
 }
开发者ID:butachi,项目名称:worktime,代码行数:7,代码来源:SessionRepository.php

示例15: forget

 /**
  * Remove an item from the session.
  *
  * @param $key
  */
 public function forget($key)
 {
     return $this->session->forget($this->getSessionKey($key));
 }
开发者ID:coreplex,项目名称:core,代码行数:9,代码来源:Illuminate.php


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