定制 voltageek/livewire-toasts-flowbite 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

voltageek/livewire-toasts-flowbite

最新稳定版本:0.2

Composer 安装命令:

composer require voltageek/livewire-toasts-flowbite

包简介

Laravel Livewire toast notifications using Alpine JS & Flowbite component (Fork of aliowa/livewire-toasts)

README 文档

README

This package allows you to dynamically display toasts notifications via Laravel Livewire components. Toasts are powered by AlpineJS and are displayed without any delay.

Documentation

Requirements

  • AlpineJS version 3.0 or higher

Installation

You can install the package via composer:

composer require voltageek/livewire-toasts-flowbite

Add the x-voltageek-livewire-toasts component to your app layout view:

<body>
  <!-- body here -->
  
  <x-voltageek-livewire-toasts-flowbite />
</body>

By default toasts are styled with TailwindCSS. To autodiscover necessary classes, either publish toasts views or add package views location to your tailwind.config.js file:

module.exports = {
    content: [
        './vendor/voltageek/**/views/**/*.blade.php',
    ],

Usage

Livewire Component Setup

Add Toastable trait to your livewire component:

<?php

namespace App\Http\Livewire;

use voltageek\LivewireToastsFlowbite\Traits\Toastable;
use Livewire\Component;

class SavePost extends Component
{
    use Toastable;

    //component code
}

Showing Toasts

Show a toast providing a message to one of four methods toastSuccess, toastWarning, toastDanger, toastInfo:

public function savePost()
{
    $this->toastSuccess('Post has been successfully saved!');

    $this->toastWarning('You have reached the daily post limit!');

    $this->toastDanger('Post has not been saved!');

    $this->toastInfo('A confirmation email has been sent');
}

Publishing Assets

Custom View

By default toasts view file uses TailwindCSS, but you can publish and change the way toasts will look on your website.

php artisan vendor:publish --tag=voltageek-livewire-toasts-flowbite:views

Now edit the view file resources/views/vendor/components/voltageek/livewire-toasts-flowbite/components/toasts.blade.php. The package will use this view to render the component.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固