Skip to content

Laraflash streamlines the process of displaying temporary messages in your Laravel application. Its focus on simplicity and performance makes it an ideal choice for projects of all sizes

License

Notifications You must be signed in to change notification settings

binkapS/Laraflash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Laraflash streamlines the process of displaying temporary messages in your Laravel application. Its focus on simplicity and performance makes it an ideal choice for projects of all sizes

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published