Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Runtime Laravel Package

boson-php/runtime

Lightweight runtime for boson-php that helps bootstrap and manage execution of Boson-based apps. Provides core runtime utilities and integration points for running, configuring, and packaging projects with minimal overhead.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Subtree split of the component (see boson-php/boson)

Frequently asked questions about Runtime
How can I use boson-php/runtime for Laravel background jobs instead of queues?
This package can replace or extend Laravel’s queue system by treating Boson tasks as discrete jobs. Register a Boson worker as a Laravel queue job (e.g., `boson:process`) and dispatch it via `dispatch(new BosonJob($payload))`. Ensure your Boson runtime is configured to handle serialization/deserialization compatible with Laravel’s job payloads.
Does boson-php/runtime integrate with Laravel’s service container (PSR-11) natively?
No, but you can manually bind Boson services in Laravel’s `AppServiceProvider` using `$this->app->singleton(BosonRuntime::class, fn() => new BosonRuntime(config('boson')))`. This allows dependency injection for Boson clients or event handlers. For full PSR-11 compliance, wrap the runtime in a container-aware adapter.
What Laravel versions does boson-php/runtime support?
The package itself is PHP 8.4+ only, but Laravel compatibility depends on your setup. Test with Laravel 10+ for best results, as older versions may lack PHP 8.4 features. Check the [Laravel adapter docs](https://bosonphp.com/doc/0.19/laravel-adapter) for version-specific guidance.
How does boson-php/runtime handle serialization for Laravel APIs?
Boson uses its own serialization format by default (not JSON), which may conflict with Laravel’s JSON APIs. Configure the runtime to use JSON or Protocol Buffers via `BosonRuntime::setSerializer()`. For APIs, transform Boson responses to Laravel-compatible formats (e.g., `json_encode()`) before returning them.
Can I use this package for real-time WebSocket events in Laravel Echo?
Yes, but you’ll need to bridge Boson events to Laravel Echo manually. Subscribe to Boson’s event bus in a service provider, then emit Laravel events (e.g., `Event::dispatch(new BosonEvent($data))`). Use Laravel Echo’s `Broadcast` trait to push events to WebSocket clients. Monitor for serialization mismatches.
What happens if the Boson runtime crashes in production?
By default, crashes will terminate the process. To improve resilience, wrap Boson operations in a `try-catch` block and log errors via Laravel’s `Log::error()`. For critical tasks, implement retry logic using Laravel’s `retry()` helper or a queue job with exponential backoff.
Are there alternatives to boson-php/runtime for Laravel event-driven workflows?
For event processing, consider `spatie/async-jobs` (for async tasks) or `laravel-websockets/laravel-websockets` (for real-time). If you need RPC-like functionality, `php-rpc/rpc` or Laravel’s built-in HTTP clients may suffice. Boson’s strength lies in its WebView runtime for complex, stateful workflows.
How do I configure boson-php/runtime for a Laravel microservice?
Start by publishing Boson’s config (if supported) or define it in `config/boson.php`. Use Laravel’s `config()` helper to access settings. For modularity, isolate Boson logic in a dedicated module (e.g., `nwidart/laravel-modules`) and bind it to Laravel’s container. Test inter-service communication with Laravel’s HTTP clients.
Does boson-php/runtime work with Laravel’s Horizon for queue monitoring?
Not directly, but you can integrate Horizon by extending its `MonitorProcesses` class to track Boson workers. Expose Boson job metrics via Laravel’s `Monitor` facade or a custom API endpoint. Ensure your Boson runtime logs job statuses in a Horizon-compatible format (e.g., JSON with `job` and `payload` fields).
How do I test boson-php/runtime in a Laravel project?
Mock Boson dependencies using Laravel’s `Mockery` or PHPUnit’s `createMock()`. Test runtime behavior by injecting a fake Boson client in your service provider. For integration tests, use Laravel’s `Http::fake()` to simulate Boson responses. Validate serialization/deserialization with `assertJson()` or custom assertions for Boson-specific formats.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky