Download the PHP package andriichuk/pushbox without Composer
On this page you can find all versions of the php package andriichuk/pushbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andriichuk/pushbox
More information about andriichuk/pushbox
Files in andriichuk/pushbox
Package pushbox
Short Description Laravel developer tool: preview FCM push payloads from notifications in the browser—Mailbook-style registry (add, to, category, variants, locales), optional DB rollback, and gated test sends.
License MIT
Informations about the package pushbox
Pushbox
Pushbox is a Laravel package inspired by Mailbook: it lets you preview FCM push payloads for Notification classes in the browser, without wiring a one-off controller in your app.
Requirements: PHP 8.4+, Laravel 11 or 12.
Installation
Register the service provider and facade (Laravel 11+ auto-discovers them; otherwise add Andriichuk\Pushbox\PushboxServiceProvider to config/app.php).
Publish configuration (optional):
Scaffold the registration file:
This creates routes/pushbox.php where you register notifications (same idea as Mailbook’s routes/mailbook.php).
Usage
Open /pushbox (or your configured pushbox.path) when the app runs with routes enabled (by default: local only — see Security).
Registering notifications
Notifiable (to())
Many notifications expect a notifiable user. Mirror Mailbook’s API:
You can also scope several registrations:
Categories & groups
Variants
Localization
Add locales to config/pushbox.php (locales array). The UI shows a dropdown; the preview resolver sets app()->setLocale() while resolving payloads.
Database rollback
When pushbox.database_rollback is true, previews run inside a DB transaction that is rolled back after rendering (handy when factories persist models), similar to Mailbook.
FCM (push)
Install the channel package (suggested):
Implement toFcm($notifiable) on your notification as documented by that package. Pushbox serializes the returned FcmMessage via toArray() for the UI — no Firebase HTTP request happens during preview.
Test sending (optional)
Dangerous: sends a real notification through your configured FCM driver.
PUSHBOX_ALLOW_SEND=truepushbox.send.fcm.token/PUSHBOX_FCM_TOKENfor test sends- By default, sends are only reasonable in
local; setPUSHBOX_SEND_NON_LOCAL=true(andpushbox.send_allow_non_local) only if you explicitly need staging.
Every send is logged under the pushbox.sent / pushbox.send_failed context.
Security
- Routes register when
pushbox.enabledis true and eitherpushbox.local_onlyis false or the environment islocal/testing. - Optional IP allowlist:
PUSHBOX_ALLOWED_IPS(comma-separated). - Keep the package in
require-devif you only need previews locally.
Mailbook parity (overview)
| Mailbook | Pushbox |
|---|---|
routes/mailbook.php |
routes/pushbox.php |
Mailbook::add() |
Pushbox::add() |
Mailbook::to() / group() / category() / variant() |
Same fluent ideas |
| Preview HTML mail | Preview FCM JSON |
| Optional send | Optional FCM send (gated) |
Testing
License
The MIT License. See LICENSE.md.
All versions of pushbox with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/contracts Version ^11.0|^12.0
illuminate/routing Version ^11.0|^12.0
illuminate/view Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/notifications Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/log Version ^11.0|^12.0