本文整理汇总了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;
}
示例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);
}
示例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');
}
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例9: forget
/**
* {@inheritdoc}
*/
public function forget($index)
{
$this->session->forget($index);
}
示例10: forget
/**
* Remove a value from the session.
*
* @param string $name
* @return mixed
*/
public function forget($name)
{
return $this->session->forget($name);
}
示例11: logout
public function logout()
{
$this->session->forget("sharp_user");
}
示例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());
}
示例14: forget
/**
* {@inheritDoc}
*/
public function forget()
{
$this->session->forget($this->key);
}
示例15: forget
/**
* Remove an item from the session.
*
* @param $key
*/
public function forget($key)
{
return $this->session->forget($this->getSessionKey($key));
}