A laravel package which make printing flashes a breeze!
This is my first ever package published. I wanted to learn how to make a simple package for Laravel. I've been reading a lot about the IoC container,
how Laravel does the dependency injection etc... This package was inspired by the great laracasts/flash package!
$ composer require linking/flashr
When the package is installed, if you're running Laravel 5.x, you can register the package in the AppServiceProvider, like this
Flashr::success("The post has been edited");
Flashr expose differents functions to print different type of flashes. Here is a list of Flashr functions :
Then, in your views, you can include the vendor views, by doing
Note: it use, by default, the Twitter Bootstrap notation. If you want to replace this behaviour, just read what's next
If you want to customize the view, simply do
php artisan vendor:publish --tag=flashr
then, go tho your views directory. You should find a vendor directory. Inside this directory, a flashr directory will be here.
You can edit this file to whatever you want. By default, the file looks like this :