我已经安装了Laracasts / Flash软件包并且已经成功使用了一段时间。我最近对我的代码进行了一些更改并添加了另一个服务提供商,现在,突然Laracasts / Flash并没有神奇地创建flash消息弹出模式。在我的本地开发环境中它确实如此,但不是在生产中:(。在我的一个控制器中,我运行此代码:
flash()->overlay("Your content may take a few minutes to be processed.", "Thanks for your submission!");
Log::info( $request->session()->all());
我检查了我的日志以找到会话数据:
[2017-05-18 02:07:08] local.INFO: array (
'_token' => 'somestring',
'backUrl' => 'https://example.com/posts',
'_previous' =>
array (
'url' => 'https://example.com/posts/create',
),
'flash' =>
array (
'old' =>
array (
),
'new' =>
array (
0 => 'flash_notification',
),
),
'login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d' => 1,
'flash_notification' =>
Illuminate\Support\Collection::__set_state(array(
'items' =>
array (
0 =>
Laracasts\Flash\OverlayMessage::__set_state(array(
'title' => 'Thanks for your submission!',
'overlay' => true,
'message' => 'Your content may take a few minutes to be processed.',
'level' => 'info',
'important' => false,
)),
),
)),
)
虽然在它工作的环境中它看起来像这样:
'flash_notification' =>
array (
'message' => 'Your content may take a few minutes to be processed.',
'level' => 'info',
'overlay' => true,
'title' => 'Thanks for your submission!',
),
所以Laracasts / Flash正在创建会话数据,但是在返回的视图中没有闪存消息。当我检查返回的网页的来源时,我没有看到我在Laracasts / Flash正常创建flash消息时所做的<div id="flash-overlay-modal" class="modal fade flash-modal"><div class="modal-dialog"><div class="modal-content"><div class="modal-header">...
。任何人对这个问题有什么想法?
我使用的是Laravel 5.2.45。
此外,我还包括@include('flash::message')
我一直在挖掘。我发布了flash供应商文件,现在我可以编辑flash :: message视图,然后在文件顶部放置一些测试文本并显示,但是视图@if (Session::has('flash_notification.message'))
中的第一个if语句从未通过
当我做Log::info($request->session()->get('flash_notification'));
时,在我的本地环境中,我得到了这个输出:
[2017-05-18 05:30:00] local.INFO: array (
'message' => 'Your content may take a few minutes to be processed.',
'level' => 'info',
'overlay' => true,
'title' => 'Thanks for your submission!',
)
在我的作品中我得到了这个输出:
[2017-05-18 17:42:21] local.INFO: [{"title":"Thanks for your submission!","overlay":true,"message":"Your content may take a few minutes to be processed.","level":"info","important":false}]