moataz-01/filament-notification-sound 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

moataz-01/filament-notification-sound

最新稳定版本:v1.0.0

Composer 安装命令:

composer require moataz-01/filament-notification-sound

包简介

Add sound notifications to Filament database notifications

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Add sound notifications to your Filament database notifications. This package plays a sound when a new database notification is received in the Filament admin panel, with optional visual animation effects.

Features

  • 🔊 Sound Notifications - Play audio when new database notifications arrive
  • 🎨 Visual Animation - Optional pulse animation on notification badge
  • 🎛️ Volume Control - Adjustable volume levels (0.0 to 1.0)
  • 🎵 Custom Sounds - Use your own notification sound files
  • ⚙️ Easy Configuration - Fluent API for simple customization
  • 🔇 Enable/Disable - Toggle the plugin on/off as needed
  • 🌐 Browser Compatibility - Handles browser autoplay restrictions automatically
  • 🎯 Filament 4 Ready - Built for the latest Filament version

Requirements

  • PHP 8.2 or higher
  • Laravel 12.x
  • Filament 4.x

Installation

You can install the package via composer:

composer require moataz-01/filament-notification-sound

You can publish the config file with:

php artisan vendor:publish --tag="filament-notification-sound-config"

You can publish the sound files with:

php artisan vendor:publish --tag="filament-notification-sound-sounds"

Usage

Register the plugin in your Filament Panel Provider:

use Moataz01\FilamentNotificationSound\FilamentNotificationSoundPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentNotificationSoundPlugin::make(),
        ]);
}

Configuration

You can configure the plugin using the fluent methods:

use Moataz01\FilamentNotificationSound\FilamentNotificationSoundPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentNotificationSoundPlugin::make()
                ->soundPath('/sounds/custom-notification.mp3') // Custom sound path
                ->volume(0.5) // Volume (0.0 to 1.0)
                ->showAnimation(true) // Show animation on notification badge
                ->enabled(true), // Enable/disable the plugin
        ]);
}

Customization

Custom Sound

To use a custom sound, place your audio file in the public directory (e.g., public/sounds/my-sound.mp3) and configure the plugin to use it:

FilamentNotificationSoundPlugin::make()
    ->soundPath('/sounds/my-sound.mp3')

Publishing Assets

If you need to customize the assets, you can publish them:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-30