webdo-cz/tall-flash

Flash messages using TALL stack

dev-main 2021-04-21 15:30 UTC

This package is not auto-updated.

Last update: 2024-04-19 05:26:51 UTC


README

Installation

install via composer

composer require webdo-cz/tall-flash

Setup

add before </body>

<livewire:flash-messages />

Usage

make a call to the flash() function.

$flash = [
    'type' => 'success',
    'title' => 'Success',
    'message' => 'Post added to our database',
];

flash($flash, $this);

($this is used for livewire support)

There are two types: success, error You can use this short function

flashSuccess([
    'title' => 'Success',
    'message' => 'Post added to our database',
], $this);

and

flashError([
    'title' => 'Error',
    'message' => 'Something bad happen',
], $this);