webdo-cz/tall-flash

使用TALL stack实现的闪存消息

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

This package is not auto-updated.

Last update: 2024-09-20 07:30:13 UTC


README

安装

通过composer安装

composer require webdo-cz/tall-flash

设置

</body>之前添加

<livewire:flash-messages />

使用方法

调用flash()函数。

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

flash($flash, $this);

(这用于Livewire支持)

有两种类型:成功、错误。你可以使用这个简短函数

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

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