shufflingpixels/laravel-toast-flux
Composer 安装命令:
composer require shufflingpixels/laravel-toast-flux
包简介
Frontend for shufflingpixels/toast using Livewire Flux, Tailwind CSS and alpinejs
README 文档
README
Frontend for shufflingpixels/laravel-toast using Livewire Flux, Tailwind CSS and Alpine.js.
This package provides a ready-made Livewire component that renders toast messages produced
by the backend package shufflingpixels/laravel-toast, styled with Flux components.
Requirements
- PHP 8.1+
- Laravel 10–12 (or
illuminate/support10–12) - Tailwind CSS 4+
- Livewire 3.5.19+
- Livewire Flux 2.5+
Installation
composer require shufflingpixels/laravel-toast-flux
The service provider is auto-discovered. No manual registration is required.
Usage
Add the toast container component to a persistent layout (e.g., just before </body> or wherever you want toasts to appear):
{{-- Renders all current toast messages --}} <livewire:toast-flux />
Popover mode (optional)
If you pass the position attribute to the component,
it renders inside a native popover element instead of a plain wrapper.
This is useful if you want to show toasts in an overlay context.
<x-toast::container position="top-right" /> <x-toast::container position="top-left" /> <x-toast::container position="bottom-right" /> <x-toast::container position="bottom-left" />
Calling from livewire
use the WithToast trait in you livewire components.
<?php namespace App\Livewire; use ShufflingPixels\Toast\Toast; use ShufflingPixels\Toast\Livewire\WithToast; use Livewire\Component; class Counter extends Component { use WithToast; public $count = 1; public function increment() { Toast::info("Incremented"); $this->count++; } public function render() { return view('livewire.counter'); } }
If doing so the livewire toast component will update without a full page load.
Customization
You can publish the Blade views and customize markup or classes:
php artisan vendor:publish --provider="ShufflingPixels\\Toast\\ToastFluxServiceProvider"
Published files live under resources/views/vendor/toast:
livewire/container.blade.phpcomponents/containers/normal.blade.phpcomponents/containers/popover.blade.php
The default message component uses:
- Flux
calloutfor styling - Severity-based icon mapping (
information-circle,check-circle,exclamation-circle,x-circle) - A close button (
flux:buttonwithx-mark) - Alpine for show/hide transitions and auto-dismiss
Tips
- Default duration is 3000 ms (set when creating messages). Set to
0to disable auto-dismiss for a message. - Place the container once in a shared layout to capture all toasts created during the request.
- Ensure Flux assets are included; missing styles/scripts will affect appearance and transitions.
Links
- Backend: shufflingpixels/laravel-toast (installed as a dependency)
- UI: livewire/flux (CSS/JS and Blade components)
shufflingpixels/laravel-toast-flux 适用场景与选型建议
shufflingpixels/laravel-toast-flux 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 149 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 shufflingpixels/laravel-toast-flux 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shufflingpixels/laravel-toast-flux 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 149
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2025-10-09