PHPackages                             andriichuk/pushbox - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. andriichuk/pushbox

ActiveLibrary[Testing &amp; Quality](/categories/testing)

andriichuk/pushbox
==================

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.

v1.0.0(1mo ago)01[2 issues](https://github.com/andriichuk/pushbox/issues)MITPHPPHP ^8.4

Since Apr 11Pushed 1w agoCompare

[ Source](https://github.com/andriichuk/pushbox)[ Packagist](https://packagist.org/packages/andriichuk/pushbox)[ RSS](/packages/andriichuk-pushbox/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (12)Versions (5)Used By (0)

Pushbox
=======

[](#pushbox)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6a1acffe5584d62fe2a633cc7060e357e3550b251f823a065843814644816b00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e647269696368756b2f70757368626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andriichuk/pushbox)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9b6d2c4380fc26140793cd2d9585ff33ca4f1fd9b48b6c2fc8c7a44f0c603ca8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616e647269696368756b2f70757368626f782f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/andriichuk/pushbox/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ffdfba48b5ce99181e660de714273e3f6a7738150856d6581c3e2e213ef9f84c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616e647269696368756b2f70757368626f782f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/andriichuk/pushbox/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/1526122acf96f2f99b840d5c7c639305ee134df447e306989776f9447de819fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e647269696368756b2f70757368626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/andriichuk/pushbox)

Pushbox is a Laravel package inspired by [Mailbook](https://github.com/Xammie/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
------------

[](#installation)

```
composer require --dev andriichuk/pushbox
```

Register the service provider and facade (Laravel 11+ auto-discovers them; otherwise add `Andriichuk\Pushbox\PushboxServiceProvider` to `config/app.php`).

Publish configuration (optional):

```
php artisan vendor:publish --tag="pushbox-config"
```

Scaffold the registration file:

```
php artisan pushbox:install
```

This creates [`routes/pushbox.php`](stubs/routes/pushbox.stub) where you register notifications (same idea as Mailbook’s `routes/mailbook.php`).

Usage
-----

[](#usage)

Open `/pushbox` (or your configured `pushbox.path`) when the app runs with routes enabled (by default: **local** only — see [Security](#security)).

### Registering notifications

[](#registering-notifications)

```
// routes/pushbox.php
use Andriichuk\Pushbox\Facades\Pushbox;
use App\Notifications\OrderShippedNotification;

Pushbox::add(OrderShippedNotification::class);

Pushbox::add(function (): OrderShippedNotification {
    $order = Order::factory()->create();

    return new OrderShippedNotification($order);
});
```

### Notifiable (`to()`)

[](#notifiable-to)

Many notifications expect a notifiable user. Mirror Mailbook’s API:

```
Pushbox::to(User::factory()->make())->add(WelcomeNotification::class);
```

You can also scope several registrations:

```
Pushbox::to(User::factory()->make())->group(function () {
    Pushbox::add(WelcomeNotification::class);
    Pushbox::add(TrialEndedNotification::class);
});
```

### Categories &amp; groups

[](#categories--groups)

```
Pushbox::category('Orders')->group(function () {
    Pushbox::add(OrderCreatedNotification::class);
    Pushbox::add(OrderShippedNotification::class);
});
```

### Variants

[](#variants)

```
Pushbox::add(OrderCreatedNotification::class)
    ->variant('1 item', fn () => new OrderCreatedNotification(Order::factory()->withOneProduct()->create()))
    ->variant('2 items', fn () => new OrderCreatedNotification(Order::factory()->withTwoProducts()->create()));
```

### Localization

[](#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

[](#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)
----------

[](#fcm-push)

Install the channel package (suggested):

```
composer require laravel-notification-channels/fcm
```

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)
-----------------------

[](#test-sending-optional)

**Dangerous:** sends a real notification through your configured FCM driver.

- `PUSHBOX_ALLOW_SEND=true`
- `pushbox.send.fcm.token` / `PUSHBOX_FCM_TOKEN` for test sends
- By default, sends are only reasonable in `local`; set `PUSHBOX_SEND_NON_LOCAL=true` (and `pushbox.send_allow_non_local`) only if you explicitly need staging.

Every send is logged under the `pushbox.sent` / `pushbox.send_failed` context.

Security
--------

[](#security)

- Routes register when `pushbox.enabled` is true and either `pushbox.local_only` is false **or** the environment is `local` / `testing`.
- Optional IP allowlist: `PUSHBOX_ALLOWED_IPS` (comma-separated).
- Keep the package in `require-dev` if you only need previews locally.

Mailbook parity (overview)
--------------------------

[](#mailbook-parity-overview)

MailbookPushbox`routes/mailbook.php``routes/pushbox.php``Mailbook::add()``Pushbox::add()``Mailbook::to()` / `group()` / `category()` / `variant()`Same fluent ideasPreview HTML mailPreview FCM JSONOptional sendOptional FCM send (gated)Testing
-------

[](#testing)

```
composer test
# or
./vendor/bin/phpunit
```

License
-------

[](#license)

The MIT License. See [LICENSE.md](LICENSE.md).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance93

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

59d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc16718c1c07d5bacc569130cc001fdad5a7598d92b9d76f47236426aa09a363?d=identicon)[andriichuk](/maintainers/andriichuk)

---

Tags

testinglaravelnotificationslaravel-packageFCMpreviewdeveloper-toolspush notificationsmailbookFirebase Cloud Messagingpushbox

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/andriichuk-pushbox/health.svg)

```
[![Health](https://phpackages.com/badges/andriichuk-pushbox/health.svg)](https://phpackages.com/packages/andriichuk-pushbox)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k28.4M134](/packages/laravel-cashier)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M120](/packages/laravel-pulse)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

268880.7k3](/packages/laravel-cashier-paddle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
