Laravel bridge for SolidFrame architectural packages.
Auto-discovery, DI bindings, Artisan generators, database stores, and modular monolith support — all wired into Laravel.
composer require solidframe/laravelThe service provider is auto-registered via Laravel's package discovery.
| Feature | What You Get |
|---|---|
| CQRS | CommandBus, QueryBus, handler auto-discovery, middleware |
| Event-Driven | EventBus, listener auto-discovery, multi-listener |
| Event Sourcing | Database EventStore, SnapshotStore, migrations |
| Saga | Database SagaStore, solidframe:saga:status |
| Modular | Module auto-discovery, ModuleServiceProvider, routes/migrations/config |
| Generators | 10 make:* commands for DDD, CQRS, events, sagas, modules |
SolidFrame automatically discovers your command handlers, query handlers, and event listeners by scanning your app/ directory.
// app/Application/Handler/PlaceOrderHandler.php
final readonly class PlaceOrderHandler implements CommandHandler
{
public function __invoke(PlaceOrder $command): void { /* ... */ }
}
// That's it. No registration needed.
$commandBus->dispatch(new PlaceOrder('order-123', 'customer-456'));Discovery works by scanning for classes that implement CommandHandler, QueryHandler, or EventListener marker interfaces and reading the __invoke() type hint.
Publish the config file:
php artisan vendor:publish --tag=solidframe-config// config/solidframe.php
return [
'discovery' => [
'enabled' => true,
'paths' => ['app'],
],
'cqrs' => [
'command_bus' => ['middleware' => []],
'query_bus' => ['middleware' => []],
],
'event_driven' => [
'event_bus' => ['middleware' => []],
],
'event_sourcing' => [
'event_store' => [
'driver' => 'database',
'connection' => null,
'table' => 'event_store',
],
'snapshot_store' => [
'driver' => 'database',
'connection' => null,
'table' => 'snapshots',
],
],
'saga' => [
'store' => [
'driver' => 'database',
'connection' => null,
'table' => 'sagas',
],
],
'modular' => [
'path' => 'modules',
'auto_discovery' => true,
],
];# DDD
php artisan make:entity Order
php artisan make:value-object Email
php artisan make:aggregate-root Order
# CQRS
php artisan make:cqrs-command PlaceOrder --handler
php artisan make:command-handler PlaceOrderHandler --command-class=PlaceOrder
php artisan make:query GetOrderById --handler
php artisan make:query-handler GetOrderByIdHandler --query-class=GetOrderById
# Event-Driven
php artisan make:domain-event OrderPlaced --listener
php artisan make:event-listener SendOrderConfirmation --event-class=OrderPlaced
# Saga
php artisan make:saga PlaceOrderSaga
# Module
php artisan make:module OrderAll generators support subdirectories: php artisan make:entity Order/OrderItem
# List registered modules
php artisan solidframe:module:list
# View saga details
php artisan solidframe:saga:status {saga-id}Publish migrations for event sourcing and saga stores:
php artisan vendor:publish --tag=solidframe-migrationsThree tables are created:
event_store— domain events with optimistic concurrency controlsnapshots— aggregate snapshotssagas— saga state with associations
php artisan make:module InventoryThis creates:
modules/
└── Inventory/
├── InventoryModule.php
├── InventoryServiceProvider.php
└── Database/
└── Migrations/
use SolidFrame\Laravel\Modular\ModuleServiceProvider;
final class InventoryServiceProvider extends ModuleServiceProvider
{
protected function module(): ModuleInterface
{
return new InventoryModule();
}
public function register(): void
{
parent::register();
// custom bindings...
}
}ModuleServiceProvider automatically loads:
routes.phpfrom the module directory- Migrations from
Database/Migrations/ config.phpmerged intomodules.{name}
When solidframe.modular.auto_discovery is true, modules are discovered and booted automatically. List them with:
php artisan solidframe:module:listAdd middleware to buses via config:
// config/solidframe.php
'cqrs' => [
'command_bus' => [
'middleware' => [
App\Middleware\TransactionMiddleware::class,
App\Middleware\LoggingMiddleware::class,
],
],
],Middleware classes are resolved from the container with full dependency injection.
The service provider registers these as singletons:
| Interface | Implementation |
|---|---|
CommandBusInterface |
CommandBus with discovered handlers |
QueryBusInterface |
QueryBus with discovered handlers |
EventBusInterface |
EventBus with discovered listeners |
EventStoreInterface |
DatabaseEventStore or InMemoryEventStore |
SnapshotStoreInterface |
DatabaseSnapshotStore or InMemorySnapshotStore |
SagaStoreInterface |
DatabaseSagaStore or InMemorySagaStore |
ModuleRegistryInterface |
InMemoryModuleRegistry |
Store driver falls back to in-memory when the configured package is not installed.
- PHP 8.2+
- Laravel 10, 11, or 12
Optional packages (installed as needed):
solidframe/ddd— formake:entity,make:value-object,make:aggregate-rootsolidframe/cqrs— for CommandBus, QueryBus, handler discoverysolidframe/event-driven— for EventBus, listener discoverysolidframe/event-sourcing— for EventStore, SnapshotStoresolidframe/modular— for module supportsolidframe/saga— for SagaStore
- solidframe/core — Bus interfaces, Middleware
- solidframe/ddd — Entity, ValueObject, AggregateRoot
- solidframe/cqrs — CommandBus, QueryBus
- solidframe/event-driven — EventBus, Listeners
- solidframe/event-sourcing — EventStore, Snapshots
- solidframe/modular — Module contracts
- solidframe/saga — Saga lifecycle
- solidframe/symfony — Symfony alternative
This repository is a read-only split of the solidframe/solidframe monorepo, auto-synced on every push to main. Issues, pull requests, and discussions belong in the monorepo.