A powerful Filament plugin for managing announcements in your Laravel application. Create, manage, and display announcements with customizable scopes, colors, and navigation controls.
You can install the package via composer:
composer require backstage/announcementsImportant
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 migrateOptionally, you can publish the views using
php artisan vendor:publish --tag="backstage-announcements-views"This is the contents of the published config file:
return [
];Add the plugin to your Filament panel provider:
use Backstage\Announcements\AnnouncementsPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
AnnouncementsPlugin::make(),
]);
}Control whether the announcements resource appears in the navigation menu:
AnnouncementsPlugin::make()
->canRegisterNavigation(false) // Hide from navigationAnnouncementsPlugin::make()
->canRegisterNavigation(true) // Show in navigation (default)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.
Once configured, you can create announcements through the Filament interface:
- Title: The announcement title
- Content: The announcement content (supports HTML)
- Scopes: Select which resources/pages the announcement should appear on
- Color: Choose a color theme for the announcement
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
composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.