backstage/announcements

This is my package backstage-announcements

Fund package maintenance!
Backstage

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 1

pkg:composer/backstage/announcements

v1.0.1 2025-10-06 12:29 UTC

This package is auto-updated.

Last update: 2025-11-17 12:29:19 UTC


README

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

A powerful Filament plugin for managing announcements in your Laravel application. Create, manage, and display announcements with customizable scopes, colors, and navigation controls.

Installation

You can install the package via composer:

composer require backstage/announcements

Important

If you have not set up a custom theme and are using Filament Panels follow the instructions in the Filament Docs first.

After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.

@source '../../../../vendor/backstage/announcements/resources/**/*.blade.php';

You can publish and run the migrations with:

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

Optionally, you can publish the views using

php artisan vendor:publish --tag="backstage-announcements-views"

This is the contents of the published config file:

return [
];

Usage

Add the plugin to your Filament panel provider:

use Backstage\Announcements\AnnouncementsPlugin;

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

Navigation Control

Control whether the announcements resource appears in the navigation menu:

AnnouncementsPlugin::make()
    ->canRegisterNavigation(false) // Hide from navigation
AnnouncementsPlugin::make()
    ->canRegisterNavigation(true) // Show in navigation (default)

Forced Scopes

Limit which scopes (resources/pages) are available when creating announcements. You can specify the full class names of resources or pages:

AnnouncementsPlugin::make()
    ->forceScopes([
        'App\\Filament\\Resources\\Users\\UserResource',
        'App\\Filament\\Resources\\Products\\ProductResource',
        'App\\Filament\\Pages\\Dashboard',
    ])

The plugin will automatically match these class names to the formatted scope names that appear in the dropdown, so users will see friendly names like "Users (list)" instead of the full class names. The form automatically converts between class names (stored in database) and formatted names (displayed in UI) using the formatStateUsing() method.

Creating Announcements

Once configured, you can create announcements through the Filament interface:

  1. Title: The announcement title
  2. Content: The announcement content (supports HTML)
  3. Scopes: Select which resources/pages the announcement should appear on
  4. Color: Choose a color theme for the announcement

Displaying Announcements

Announcements are automatically displayed on the selected scopes using the included Livewire component. The component handles:

  • Dismissal tracking per user
  • Color theming
  • Responsive design
  • Accessibility features

Testing

composer test

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.