crustum/broadcasting
Lightweight broadcasting package for Laravel that lets you push real-time events to your frontend without a third-party service. Simple setup, integrates with Laravel's event system, and keeps live updates easy to manage in any app.
TestQueueAdapter plus assertBroadcastQueued, assertBroadcastQueuedToChannel, and assertNoBroadcastsQueued let us assert broadcast behavior in the suite instead of manually faking the queue per test. This directly reduces regression risk on the highest-risk part of real-time features — "did the event actually go out, on the right channel, once?"BroadcastingTraitInterface gives a static-analysis-friendly contract. That lowers the cost of onboarding engineers and of writing custom broadcast behavior later, and it makes future refactors of table classes safer.BroadcastingBehavior into BroadcastingTrait is an internal quality signal. It means broadcasting can be composed onto classes beyond tables if the roadmap calls for it, and it reduces the chance that a behavior change forces a fork.Adopt when:
TestQueueAdapter are the strongest reason to take 1.1.0 specifically rather than staying on 1.0.x.BroadcastingBehavior must now also use BroadcastingTrait and implement BroadcastingTraitInterface.Look elsewhere (or defer) when:
1.0.x, confirm the 1.0 line still receives security/patch fixes, and revisit at 2.0.Open questions to resolve with the maintainer before committing: Is there a migration guide for the 1.1.0 breaking change? Is 1.0.x still supported? Are the new test helpers stable API or likely to churn?
To executives: This package is the cheapest credible path to live-updating screens. Version 1.1.0 adds the two things that make a dependency safe to bet on — automated tests for broadcast behavior and a typed contract for the code. The cost is a contained, one-time upgrade (add a trait and an interface to existing table classes) and no new infrastructure. The alternative is building and maintaining the same event plumbing ourselves. Recommendation: adopt for the live-dashboard workstream, pin the version, and schedule the migration as a discrete ticket rather than letting it surface mid-sprint.
To engineering: 1.1.0 is a breaking change in a minor release. Broadcasting logic moved out of BroadcastingBehavior into BroadcastingTrait; BroadcastingBehavior now requires both the trait and BroadcastingTraitInterface. Migration per table class is mechanical but must be exhaustive — miss one and it fails at runtime, not compile time. In exchange we get TestQueueAdapter and queue assertions, which let us cover "did we broadcast, to the right channel, exactly once" in CI instead of hoping. PHPUnit moved to 12.5, so verify our test toolchain and PHP 8.3+ baseline before upgrading. Suggested sequence: inventory BroadcastingBehavior usages → migrate on a branch → add broadcast assertions to existing table tests → ship.
How can I help you explore Laravel packages today?