- What does geekcodev/filament-max-broadcasts actually do?
- It is a Filament plugin for Laravel applications that caps how many broadcast notifications can be dispatched from the panel. Instead of letting an admin blast unlimited database or broadcast notifications to users, the package enforces a configurable maximum. That protects your users from notification spam and your queue and database from sudden spikes. Check the repository README for the exact enforcement point and supported drivers, since the package is small and its behaviour is defined there.
- How do I install geekcodev/filament-max-broadcasts with Composer?
- Install it as a dev-independent dependency with composer require geekcodev/filament-max-broadcasts. Because it is a Filament plugin, you then register the plugin on your panel provider, typically by adding it to the plugins array of your Panel configuration. After that, run the publish command if the README lists one, so any config file or migration ships into your app. Always confirm the required Filament major version before installing on an existing panel.
- Which Laravel and Filament versions does this package support?
- Compatibility is declared in the package composer.json, so check the require block for the Laravel and Filament constraints it accepts. Filament plugins are tightly coupled to a Filament major version, so a package built for Filament 3 will not load on a Filament 4 panel. Run composer why-not geekcodev/filament-max-broadcasts if the install fails on version constraints. Pin the package version in composer.json for reproducible deployments.
- How do I configure the maximum number of broadcasts?
- Configuration is normally done through a published config file or through the plugin's fluent configuration methods on the panel provider. The README is the authoritative reference for the exact key names and method signatures. Set a sensible default that matches your audience size, then override per environment if staging needs a lower limit. Commit the config file to version control so limit changes are reviewed like any other code change.
- Do I need to publish assets or run migrations after installing?
- That depends on whether the package stores counters in the database or reads limits from config only. Run php artisan vendor:publish with the package tag shown in the README, then php artisan migrate if a migration is included. If no migration is shipped, the limit is likely resolved from configuration or from your notification classes. Clear cached config with php artisan config:clear after changing any limit values.
- Can I set different broadcast limits per user, role, or notification type?
- Granular scoping depends on what the package exposes, which the README documents. Filament plugins commonly let you pass a closure or a policy-driven value so limits can vary by tenant, role, or notification class. If the built-in options are too coarse, you can wrap your own dispatch logic with a guard that checks a per-user counter. Test the scoping explicitly, because an off-by-one in a limit check is easy to miss.
- Does it work with queued notifications and Laravel's notification system?
- The package sits in front of the dispatch step, so it applies regardless of whether the notification implements ShouldQueue or sends immediately. That means the limit is checked when the broadcast is triggered from the panel, not when the worker eventually processes the job. If you fan out one broadcast into many queued jobs, size your queue workers for the maximum permitted burst. Verify behaviour with a real queue connection in staging rather than the sync driver alone.
- How do I write tests for broadcast limits in my Laravel test suite?
- Use Notification::fake() and assert that no notification is sent once the configured maximum is reached, and that the next attempt is blocked or reported. Filament provides Livewire testing helpers, so you can call the panel action and assert the component state and any limit message. Reset the counter between tests by using RefreshDatabase or by clearing whatever store the package uses. Keep one test that pins the boundary exactly at the limit, and one just past it.
- Will this package slow down my Filament admin panel in production?
- A limit check is a cheap operation, but the cost depends on the storage backend: a config lookup or cache read is negligible, while a database count query on every dispatch adds a round trip. If the README indicates database-backed counters, make sure the relevant columns are indexed. Also cache your config in production with php artisan config:cache, which is standard Laravel practice. Benchmark the panel action once with realistic data volumes before you rely on it at scale.
- What are the alternatives if I need more advanced broadcast throttling?
- Laravel ships RateLimiter and the rate-limiting middleware, which you can apply to custom broadcast endpoints or jobs for per-user throttling. For notification-specific concerns, you can implement ShouldBeUnique or shouldSend on your Notification classes to skip duplicates and respect user preferences. Filament itself also lets you guard actions with authorization policies. This package is a good fit when you want the limit expressed directly in the panel configuration; reach for the framework primitives when you need sliding windows or distributed counters.