Support the ongoing development of Laravel.io →
Session Packages
Last updated 2 years ago.
0

First, check that the flash facade got imported. Run php artisan tinker from your project directory and run this:

\Flash::info('hello');
0

I use the package from caffinated.

"caffeinated/flash": "dev-master",
0

Xum, thanks for your reply, yes the thing that Flash is not getting imported. But as I mentioned before I updated my service providers and aliases, and used "Laracasts\Flash\Flash;", but still it throws error. It is the first package which does not work according guides, as I have imported and used quite some without problem. I think I will just switch to another flash package as illuminate3 suggested or will use Session::flash for that job.

0

I am once again back on this topic, as I can not get imported Flash package neither from "laracasts/flash" or neither from "caffeinated/flash". Whenever I try to access Flash class, I got "Flash class not found..."

So I will try to explain step by step what I did, to figure out what I have done wrong:

  • composer require caffeinated/flash
  • added 'Caffeinated\Flash\FlashServiceProvider' to providers array in config/app.php
  • added 'Flash' => 'Caffeinated\Flash\Facades\Flash' to aliases array in config/app.php
  • run composer dump-autoload

And now when I try to access Flash facade, I import Facade at the top of the class I am using

use Caffeinated\Flash;

However I can not reference it neither by Flash or neither by \Flash. I always get Flash class not found...

Last updated 9 years ago.
0

this might be a little to late, but make sure that you have both:

'Laracasts\Flash\FlashServiceProvider',

and

'Flash'     => 'Laracasts\Flash\Flash',

in your config/app.php file

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.