- How do I install cosmira/nginx-pushstream-broadcaster in Laravel?
- Install it with Composer using composer require cosmira/nginx-pushstream-broadcaster, then add the ReceivesPushstreamNotifications trait to your authenticatable User model and set NGINX_PUSHSTREAM_CHANNEL_SALT. For custom domain notifications, select PushstreamChannel::class and implement toPushstream() so delivery follows Laravel notification contracts.
- Which Laravel, PHP, and nginx Push Stream versions are supported?
- The provided evaluation does not pin exact Laravel, PHP, or nginx Push Stream version numbers, so check the package composer.json and README before installing. It does reference stock Laravel Authenticatable composition and local runtime verification with HTTP fakes.
- How do I send a Laravel notification over nginx Push Stream?
- Add the ReceivesPushstreamNotifications trait to your Notifiable model, configure the channel salt, and call $user->notify(new PushstreamNotification(...)). Custom notifications can use PushstreamChannel::class with a toPushstream() method for domain-specific payloads.
- Does this package require WebSockets?
- No. It is designed for nginx Push Stream, which keeps persistent client connections open over lightweight HTTP streaming while PHP publishes messages. This makes it an alternative to WebSocket or Pusher-style broadcasting when you already operate nginx Push Stream.
- How do I configure or rotate the pushstream channel salt?
- Set NGINX_PUSHSTREAM_CHANNEL_SALT in the package configuration, and preserve the existing salt during migration to avoid breaking personal subscriptions. The evaluation flags salt rotation as a procedure you must define and test before production rather than changing it blindly.
- How do I test pushstream notifications in Laravel?
- Use Laravel's Notification::fake() to assert that notifications are sent and HTTP fakes for local publisher verification. The package reports 101 tests and 323 assertions with full line and method coverage, but that is local evidence rather than proof of live nginx-to-browser delivery.
- What happens when the channel salt or user identity is missing?
- Missing identities or salts disable personal routing and may fail silently unless the application is instrumented. Add logging or alerts around this path and verify the behavior in staging before relying on personal notifications in production.
- Are pushstream notifications sent synchronously or can I queue them?
- The supplied notification wrapper sends synchronously, which can add request latency and tie up web workers for high-volume or latency-sensitive notifications. Use Laravel queues for domain notifications where possible and review timeout, retry, and failure semantics before production rollout.
- How does subscriber authentication work with nginx Push Stream channels?
- A channel name does not authenticate subscribers; the package derives and routes channels but does not establish subscriber authorization. Enforce subscriber authentication and authorization in your nginx Push Stream configuration or application boundary outside this package.
- What deployment checks prove live nginx-to-browser delivery?
- The local suite does not prove real nginx-to-browser delivery, so define deployment acceptance criteria that exercise actual nginx Push Stream connections and browser clients in staging. Validate one low-risk notification first, then expand rollout while monitoring channel routing and delivery behavior.