Flash Session messages for Laravel and Livewire
composer require binkap/laraflash
<x-laraflash::container />
export default {
content: [
"./vendor/binkap/laraflash/src/views/**/*.blade.php",
],
}
Choose the method most convenient for you.
use function Binkap\Laraflash\flash;
flash()->message('Message sent successfully')
->success() // Optional (Uses default when not specified)
->livewire($component); /* Call the livewire method to flash the message with livewire */
use function Binkap\Laraflash\alert;
alert()->message('Message sent successfully')
->success() // Optional (Uses default when not specified)
->livewire($component); /* Call the livewire method to flash the message with livewire */
use Binkap\Laraflash\Laraflash;
Laraflash::message('Provide a valid message')
->warning()
->livewire($component); /* Call the livewire method to flash the message with livewire */
// MODE methods
$flash->success() // For success
$flash->warning() // For warnings
$flash->danger() // For errors
Here are example of rendered messages
See CHANGELOG for Changes