Download the PHP package linking/flashr without Composer
On this page you can find all versions of the php package linking/flashr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package flashr
Flashr
A laravel package which make printing flashes a breeze!
Introduction
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!
Installation
Run
When the package is installed, if you're running Laravel 5.x, you can register the package in the AppServiceProvider, like this
If you're running an older version of Laravel, you can edit the app.php file, and add this in the providers
option
You should also add the Facade, in the file app.php, under the 'aliases' key, add
Usage
Within your controllers, you can do
Flashr expose differents functions to print different type of flashes. Here is a list of Flashr functions :
Flashr::success($message)
Flashr::info($message)
Flashr::warning($message)
Flashr::danger($message)
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
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 :
As you can see, the plugin add two keys in the session: _flashr.type
and _flashr.message