artisan-toolbox / mosaicast
Mosaicast is a Laravel event delivery package that intelligently routes events through the channel best suited to the current context.
Fund package maintenance!
Requires
- php: ^8.5
- artisan-toolbox/core: ^1.0
- illuminate/support: ^13.0
Requires (Dev)
- artisan-toolbox/maintainer: ^1.0
- driftingly/rector-laravel: ^2.5
- larastan/larastan: ^3.9
- laravel/pao: ^1.0
- laravel/pint: ^1.29
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.0
- pestphp/pest-plugin-laravel: ^5.0
- pestphp/pest-plugin-type-coverage: ^5.0
- phpstan/extension-installer: ^1.4
- rector/rector: ^2.6.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Mosaicast
Laravel event delivery through Inertia props or private session broadcasting.
Installation
You can install the package via Composer:
composer require artisan-toolbox/mosaicast
Requires PHP 8.5 and Laravel 13.
Usage
Dispatch an event during a request:
use ArtisanToolbox\Mosaicast\Facades\Mosaicast; Mosaicast::dispatch('orders.updated', [ 'orderId' => $order->id, ]);
The mosaicast() helper offers the same implicit dispatch API. Call it without
an event to target a captured session explicitly: mosaicast()->toSession($identifier)->dispatch(...).
An Inertia response that resolves the mosaicast shared prop carries the event in mosaicast.events. Other responses use the current session's private broadcast channel. See the complete documentation for jobs, event objects, channel authorization, and the Vue client.