承接 lbreda/livewire3-notify 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lbreda/livewire3-notify

最新稳定版本:v1.0

Composer 安装命令:

composer require lbreda/livewire3-notify

包简介

Simple Notify binding for Livewire3

README 文档

README

Livewire3 Notify is a Livewire3 binding for SimpleNotify. That's it.

Installation

You have to install both SimpleNotify and this library:

npm i simple-notify
composer require lbreda/livewire3-notify

Then you should include the SimpleNotify scripts in your app.js (or equivalent):

import Notify from 'simple-notify'
import 'simple-notify/dist/simple-notify.css'
window.Notify = Notify

And this library component in your main layout:

<html>
<head>
    ...
    @simpleNotify()
</head>
<body>
...

</body>
</html>

Usage

You can simply dispatch the notify event inside your Livewire application. You can set the Simple Notify parameters (here is a reference) in the payload.

For example, you can use it in a component method:

#[On('test')]
public function test(): void
{
    $this->dispatch('notify', status: 'error', title: 'Error', text: 'Send halp');
}

or you can use it in a view:

<div>
    <button type="button" wire:click="$dispatch('notify', {status: 'error', title: 'Error', text: 'Send halp'})">Notify</button>
</div>

Setting up the default configuration

You can export the default configuration via:

 php artisan vendor:publish --provider 'LBreda\Livewire3Notify\Providers\SimpleNotifyServiceProvider'

You'll find a simple-notify.php file in your config directory. Customise it as you like.

Happy coding!

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3
  • 更新时间: 2024-08-13