Skip to content

Latest commit

 

History

History
90 lines (60 loc) · 2.11 KB

README.md

File metadata and controls

90 lines (60 loc) · 2.11 KB

Laraflash

Flash Session messages for Laravel and Livewire

Total Installs Latest Stable Version Software License

Installation

composer require binkap/laraflash 

Add the flash container to your layout

 <x-laraflash::container />

Laraflash currently uses Tailwind CSS

export default {
    content: [
        "./vendor/binkap/laraflash/src/views/**/*.blade.php",
    ],
}

Flashing messages

Choose the method most convenient for you.

1: Helper Functions

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 */

Or

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 */

2: Facade

use Binkap\Laraflash\Laraflash;

Laraflash::message('Provide a valid message')
->warning()
->livewire($component); /* Call the livewire method to flash the message with livewire */

All methods

// MODE methods

$flash->success()  // For success
$flash->warning()  // For warnings
$flash->danger() // For errors

Rendered messages

Here are example of rendered messages

DarkMode

DarkMode flash

LightMode

LightMode flash

See CHANGELOG for Changes