Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/binkaps/laraflash

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
https://github.com/binkaps/laraflash

flash laraflash laravel livewire

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# Laraflash

Flash Session messages for Laravel and Livewire


Total Installs
Latest Stable Version
Software License

## Installation

```bash
composer require binkap/laraflash
```

## Add the flash container to your layout

```html

```

## Laraflash currently uses Tailwind CSS

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

## Flashing messages

Choose the method most convenient for you.

## 1: Helper Functions

```php
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

```php
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

```php
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

```php
// 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](CHANGELOG.md) for Changes