{"repo":"spatie/laravel-flash","free":true,"listed":false,"github":"https://github.com/spatie/laravel-flash","clone":"git clone https://github.com/spatie/laravel-flash.git","description":"A lightweight package to flash messages","language":"PHP","stars":671,"topics":["flash","message","laravel","php"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"A lightweight package to flash messages This is a lightweight package to send flash messages in Laravel apps. A flash message is a message that is carried over to the next request by storing it in the session. This package only supports one single flash message at a time. This is how it can be used: In your view you can do this: Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation You can install the package via composer: Usage Here is an example on how to flash a message. In your view you can use it like this Using a class name to style the displayed message You can add a class as the second parameter. This is typically used to style the output in your HTML. In your view you can use the class like this: You can also set an array of classes. These will be output by flash()- class by imploding the array with a space-delimiter. Adding your own methods If you don't want to specify a class each time you flash a message you can add a method name to flash . The easiest way is by passing an array to the levels method. The key is the method name that should be added to flash() . The value is the class that will automatically be used when rendering the message","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-flash/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}