Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如果把error放到session里面,而我的session又用了redis的话,会有非常难受的问题出现 #2137

Open
letsbrowser opened this issue Sep 27, 2024 · 1 comment

Comments

@letsbrowser
Copy link

@if($error = session()->get('error'))
    <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
        <h4><i class="icon fa fa-ban"></i> &nbsp;{{ \Illuminate\Support\Arr::get($error->get('title'), 0) }}</h4>
        <p>{!!  \Illuminate\Support\Arr::get($error->get('message'), 0) !!}</p>
    </div>
@elseif ($errors = session()->get('errors'))
    @if ($errors->hasBag('error'))
      <div class="alert alert-danger alert-dismissable">

        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
        @foreach($errors->getBag("error")->toArray() as $message)
            <p>{!!  \Illuminate\Support\Arr::get($message, 0) !!}</p>
        @endforeach
      </div>
    @endif
@endif

image

如果有错误提示的话,后台全部页面都会提示。最关键的是,即使我修复了问题,只要session不过期,他一直在。。

我找了快一天,实在没办法了,只好去看包的代码,才发现有这么神奇的一幕。

另外,在解决问题的时候,我尝试重装环境,更是痛苦,发现laravel 8./9./10.*都有各种问题。

  • Laravel Version: #.#.#
  • PHP Version: #.#.#
  • Dcat Admin Version: #.#.#

Description:

Steps To Reproduce:

@PorygonCN
Copy link
Collaborator

这是一个常见的类找不到的错误 确认一下文件名与类名是否对应?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants