hasanyagout/filament-announcements
最新稳定版本:1.0.0
Composer 安装命令:
composer require hasanyagout/filament-announcements
包简介
Global announcement system for different users
关键字:
README 文档
README
A powerful Filament plugin for broadcasting announcements to all users or specific recipients with support for scheduling, dismissible alerts, live updates, and custom recipient models.
Features
- ✅ Global announcements
- ✅ Targeted recipients
- ✅ Dismissible announcements
- ✅ Live polling updates
- ✅ Scheduled announcements
- ✅ Multiple announcement types
- ✅ Translation ready
- ✅ Filament native UI
- ✅ Custom recipient models
- ✅ User-specific visibility
- ✅ Laravel policy support
Installation
Install the package via Composer:
composer require hasanyagout/filament-announcements
Important
If you are using Filament Panels and have not set up a custom theme yet, follow the official Filament documentation first:
https://filamentphp.com/docs/4.x/styling/overview#creating-a-custom-theme
After setting up a custom theme, add the plugin views to your theme CSS file:
@source '../../../../vendor/hasanyagout/announcements/resources/**/*.blade.php';
Publish and run migrations:
php artisan vendor:publish --tag="announcement-migrations"
php artisan migrate
Publish the config file:
php artisan vendor:publish --tag="announcement-config"
Optionally publish translations:
php artisan vendor:publish --tag="announcement-translations"
Optionally publish views:
php artisan vendor:publish --tag="announcement-views"
Setup
- Register the plugin inside your Filament panel provider:
use HasanYagout\Announcement\AnnouncementPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ AnnouncementPlugin::make(), ]); }
- Add the trait to your User model:
use HasanYagout\Announcement\Traits\HasAnnouncements; class User extends Authenticatable { use HasAnnouncements; }
Configuration
Example configuration:
use App\Models\User; return [ 'recipient_models' => [ User::class => [ 'label' => 'Users', 'title_attribute' => 'name', ], ], ];
Polling Interval
Customize the polling interval:
AnnouncementPlugin::make() ->pollingInterval('10s')
Custom Recipient Models
You can register custom recipient models dynamically:
AnnouncementPlugin::make() ->withCustomRecipients([ App\Models\User::class => [ 'label' => 'Users', 'title_attribute' => 'name', ], ])
Announcement Types
Supported announcement types:
infowarningdangersuccess
Translation Support
The plugin is fully translation-ready.
Example:
__('announcement::filament.form.title.label')
Scheduling
Announcements support scheduling using:
starts_atends_at
Only active announcements are displayed automatically.
Dismissible Announcements
Users can dismiss announcements individually.
Dismiss states are stored per recipient.
Recipient Targeting
Announcements can be:
- Global (
is_global) - Assigned to specific users/models
Supported via polymorphic recipient relationships.
Permissions & Policies
The plugin supports Laravel Policies.
Example policy registration:
Screenshots
Add screenshots here later.
Example:

Testing
composer test
Changelog
Please see CHANGELOG for more information about recent changes.
Contributing
Contributions, issues, and feature requests are welcome.
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.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-25