Laravel 5.2:没有为[flash]定义提示路径 [英] Laravel 5.2 : No hint path defined for [flash]

查看:214
本文介绍了Laravel 5.2:没有为[flash]定义提示路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装"laracasts/flash": "^1.3"程序包后,我试图进行查看,这是我的代码:

After installed "laracasts/flash": "^1.3" package, I am trying to make a view and this is my code:

@include('gazett.errors')

gazett.errors blade.php文件代码在此处:

Where in gazett.errors blade.php file code is here :

<div class="row">
<div class="col-md-7 col-md-push-3" style="padding: 5px 24px!important;">
    @include('flash::message')
    @if($errors->any())
        <ul class="alert alert-danger text-center rtl ur fsize26" style="list-style: none;">
            @foreach($errors->all() as $error)
                <li style="color: #000 !important;"> {{ $error }} </li>
            @endforeach
        </ul>
    @endif
</div>

但是我得到这个错误:没有为[flash]定义提示路径.

But I get this error: No hint path defined for [flash].

我的目录结构在链接目录结构中给出 当我访问浏览器时,错误就在这里:

Where my directory structure is given in link Directory Structure When I visit browser, the error is here :

ErrorException in FileViewFinder.php line 112:

没有为[flash]定义提示路径. (视图:E:\ Web \ xampp \ htdocs \ wifaq-atropos \ resources \ views \ gazett \ errors.blade.php)(视图:E:\ Web \ xampp \ htdocs \ wifaq-atropos \ resources \ views \ gazett \ errors.blade.php)(查看:E:\ Web \ xampp \ htdocs \ wifaq-atropos \ resources \ views \ gazett \ errors.blade.php)

No hint path defined for [flash]. (View: E:\Web\xampp\htdocs\wifaq-atropos\resources\views\gazett\errors.blade.php) (View: E:\Web\xampp\htdocs\wifaq-atropos\resources\views\gazett\errors.blade.php) (View: E:\Web\xampp\htdocs\wifaq-atropos\resources\views\gazett\errors.blade.php)

当我尝试将laravel版本从5.0升级到5.2时,就会出现该问题.在以前版本的项目5.0中没有错误的地方.如何解决?

That issue come out when I try to upgrade laravel version from 5.0 to 5.2. Where no error in previous version project 5.0. How to fix it ?

推荐答案

使用larvael 5.2时出现类似错误,这是我的解决方法.

I had similar error when using larvael 5.2, here is how i resolved it.

将此服务提供商包含在您项目的config/app.php中

Include this service provider within config/app.php of your project

'providers' => [
        Laracasts\Flash\FlashServiceProvider::class,];

在同一文件中查找别名;添加此行

On the same file look for aliases; add this line

'aliases' => [  'Flash' => Laracasts\Flash\Flash::class, ]

上面对config/app.php的添加使我认为@include('flash :: message')可以正常工作

The above addition to config/app.php makes @include('flash::message') in my view to work fine

这篇关于Laravel 5.2:没有为[flash]定义提示路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆