f1uder/laravel-notification
最新稳定版本:1.2.1
Composer 安装命令:
composer require f1uder/laravel-notification
包简介
Laravel Livewire Notification (+ AlpineJS)
README 文档
README
Installation
You can install the package via composer:
composer require f1uder/laravel-notification
Publish the config file with:
php artisan vendor:publish --tag="laravel-notification"
Add css file (notification.css)
@import "../../public/vendor/laravel-notification/css/notification.css"; @tailwind base; @tailwind components; @tailwind utilities;
Add code to template, after body tag
<body> <livewire:laravel-notification.notice/> ... </body>
Usage Laravel
return redirect('/')->notice('message text', 'alert');
return redirect()->route('home')->notice('message text', 'info');
Usage Livewire component
$this->notice('message text', 'alert');
return redirect('/')->notice('message text', 'alert');
Usage alpineJS
$dispatch('notice', {message: 'message text', type: 'alert'});
Arguments
Usage: notice($message, $type, $timer, $title)
$message- Message.$type- Notification type.alertinfo- defaultsuccess
$timer- 3000 default = 3 sec.$title- Notification header. Default = null.
Config
config/notification.php
$timer- Notification display time in seconds.$position- Notification position.tr- Top right (default).tl- Top left.br- Bottom right.bl- Bottom left.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 210
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-19