承接 nawasara/toaster 相关项目开发

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

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

nawasara/toaster

最新稳定版本:v0.1.0

Composer 安装命令:

composer require nawasara/toaster

包简介

Lightweight, Alpine-based toast notification component for Laravel and Livewire applications.

README 文档

README

Lightweight, Alpine-based toast notification component for Laravel and Livewire applications. Drop one component into your layout and trigger toasts from JavaScript, Livewire, or session flash.

Features

  • Four toast types — success, error, warning, info
  • Configurable position — nine corner/edge anchors
  • Progress bar — optional countdown indicator
  • Dark-mode aware — respects the host application's theme
  • Mobile responsive
  • Triggers from anywhere — JavaScript (window.Toast), Livewire dispatch, or Laravel session flash
  • Auto-init from flash — shows the toast on next page load when redirected with a flash payload

Installation

composer require nawasara/toaster

Auto-discovered. Drop the toaster + script components into your layout:

<x-nawasara-toaster::script />

{{-- … your content … --}}

<x-nawasara-toaster::toaster position="top-right" :duration="5000" />

Usage

From JavaScript

window.Toast.success('Saved successfully');
window.Toast.error('Something went wrong');
window.Toast.warning('Heads up');
window.Toast.info('FYI');

From Laravel session flash

session()->flash('toast', [
    'type' => 'success',
    'message' => 'Saved successfully',
]);

return redirect()->back();

The toaster auto-loads the flash payload via window.Laravel.toast on the next page render.

From Livewire

Use the HasToaster trait if you prefer session-flash style (works after a redirect):

use Livewire\Component;
use Nawasara\Toaster\Concerns\HasToaster;

class MyComponent extends Component
{
    use HasToaster;

    public function save()
    {
        // …
        $this->alert('success', 'Saved successfully');
    }
}

For real-time toasts inside the same Livewire request (no page reload), use Nawasara\Ui\Livewire\Concerns\HasBrowserToast from nawasara/ui — it dispatches a browser toast event the toaster listens to.

Author

Pringgo J. Saputro <odyinggo@gmail.com>

License

MIT

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固