承接 marcelodelgado/filament-announcements 相关项目开发

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

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

marcelodelgado/filament-announcements

Composer 安装命令:

composer require marcelodelgado/filament-announcements

包简介

Filament v5 plugin for institutional announcements on the admin dashboard

README 文档

README

Filament Announcements Banner

Latest Version Total Downloads PHP Version License

Filament Announcements

A Filament v5 plugin to display institutional announcements and alerts on your panel dashboard — with full CRUD, per-user dismiss, and automatic expiration.

Screenshots

Dashboard Widget

Widget

Announcements List

List

Create / Edit Form

Form

Features

  • 📢 Dashboard widget — displays active announcements ordered by severity
  • Full CRUD via AnnouncementResource with type badges, bulk actions and inline toggles
  • Automatic expiration — uses starts_at / expires_at date windows, no jobs required
  • 👤 Per-user dismiss — dismissible announcements are remembered per user via a pivot table
  • 🔒 Flexible permissions — works out-of-the-box, with optional Gate or Spatie integration
  • 🌍 Translatable — all strings go through __() with publishable language files
  • 🎨 4 severity levelsinfo, warning, danger, success with Filament semantic colors

Requirements

Dependency Version
PHP 8.2+
Laravel 11+
Filament 5.x
spatie/laravel-package-tools ^1.16

Installation

Install via Composer:

composer require marcelodelgado/filament-announcements

Publish and run the migrations:

php artisan vendor:publish --tag="announcements-migrations"
php artisan migrate

Optionally publish config and views to customize them:

php artisan vendor:publish --tag="announcements-config"
php artisan vendor:publish --tag="announcements-views"
php artisan vendor:publish --tag="announcements-translations"

Setup

1. Register the plugin in your PanelProvider

use Marcelodelgado\Announcements\AnnouncementsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(
            AnnouncementsPlugin::make()
                ->pollingInterval('120s') // optional, default: '60s'
        );
}

2. Add the trait to your User model

use Marcelodelgado\Announcements\Traits\HasAnnouncements;

class User extends Authenticatable
{
    use HasAnnouncements;
}

That's it — the widget will appear on your dashboard and the Announcements menu item will show up in the sidebar.

Configuration

After publishing, edit config/announcements.php:

Key Type Default Description
permission_check null, string or Closure null Access control for the Resource. null = no extra check. string = Laravel Gate name. Closure = receives the authenticated user, must return bool.
polling_interval string '60s' Fallback wire:poll interval for the widget when the panel plugin interval cannot be resolved.

Permissions example

// config/announcements.php

// Using a Laravel Gate:
'permission_check' => 'manage-announcements',

// Using a closure:
'permission_check' => fn ($user) => $user->hasRole('admin'),

// Using Spatie Permission:
'permission_check' => fn ($user) => $user->can('manage-announcements'),

How it works

Widget — only shows announcements where is_active = true and the current time falls within the starts_at / expires_at window. Results are ordered with danger first, then by created_at descending.

Dismiss — when a user closes a dismissible announcement, the action is recorded in the announcement_user pivot table (dismissed_at). That announcement will never show again for that user. Non-dismissible announcements hide the close button entirely.

Expiration — handled purely by the query. No scheduled commands required.

Translations

The plugin ships with English strings. To add your own language, publish the translation files:

php artisan vendor:publish --tag="announcements-translations"

This will create lang/vendor/announcements/{locale}/announcements.php where you can override any string.

Roadmap

  • Audience targeting by role / group
  • Custom icon picker per announcement
  • Optional CTA link/button on the widget
  • Multi-panel support
  • announcements:prune artisan command

Changelog

Please see CHANGELOG.md for details on recent changes.

Contributing

Pull requests are welcome! Please keep the scope aligned with the package goals.

  • Run vendor/bin/pint before submitting PHP changes
  • Add tests for new behaviour when applicable
  • Open an issue first for significant changes

License

MIT — see LICENSE for details.

Made with ❤️ by Marcelo Delgado

marcelodelgado/filament-announcements 适用场景与选型建议

marcelodelgado/filament-announcements 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 299 次下载、GitHub Stars 达 5, 最近一次更新时间为 2026 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「alerts」 「laravel」 「dashboard」 「announcements」 「filament」 「filament-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 marcelodelgado/filament-announcements 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 marcelodelgado/filament-announcements 我们能提供哪些服务?
定制开发 / 二次开发

基于 marcelodelgado/filament-announcements 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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