Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.2 : No hint path defined for [flash]

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

@include('gazett.errors')

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>

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:

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)

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 ?

like image 485
saeed ahmed Avatar asked Feb 23 '16 11:02

saeed ahmed


2 Answers

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

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, ]

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

like image 173
Seunope Avatar answered Nov 02 '22 22:11

Seunope


And then, if using Laravel 5, include the service provider within config/app.php.

'providers' => [
    'Laracasts\Flash\FlashServiceProvider'
];
like image 35
S. Wiwat Avatar answered Nov 02 '22 20:11

S. Wiwat