![]() |
Flash Messages Package for Laravel |
Simple Flash Messages for Laravel Framework Applications.
|
Overview
This package allows to use Bootstrap 3/4/5 flash messaging for Laravel 6+ framework applications.
Installation
Begin by pulling in the package through Composer.
composer require apphp/flash
Next, make sure the default CSS classes for your flash message are optimized for Bootstrap. You may either pull in the Bootstrap's CSS within your HTML or layout file, or write your own CSS classes based on them. If you use Bootstrap 3, part of classes, like "primary" and "secondary" will not have styling.
<link rel="stylesheet" href="//getbootstrap.com/docs/4.0/dist/css/bootstrap.min.css">/span>
Usage
In your controllers, before you perform a redirect or render a view, make a call to the flash()
function.
public function store() { flash('Welcome Message!'); return redirect()->route('home'); }
Demo: GitHub
Features
- Multiple messages
- Hidding messages
- Standard and short syntax
- Bootstrape based
Requirements
- PHP >=7.0
- Laravel 6+
- Bootstrap 3+
Instructions
Related products