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
Php Persistence

Php Persistence Laravel Package

event-engine/php-persistence

Event Engine PHP Persistence Package providing persistence layer utilities for PHP-based event-sourced and CQRS applications. Supports storing and retrieving events and state in a consistent way to integrate with Event Engine workflows.

View on GitHub
Deep Wiki
Context7

Event Engine PHP Persistence Package

Frequently asked questions about Php Persistence
How do I integrate this package into an existing Laravel project with event-driven workflows?
Start by installing via Composer (`composer require event-engine/php-persistence`), then configure your database schema for event and aggregate tables. Replace or extend Laravel’s native event system by creating custom listeners that delegate to the package’s persistence layer. Ensure your `EventServiceProvider` binds handlers to the package’s event store.
Does this package support Laravel’s native event system, or does it require a full rewrite?
The package is designed to augment or replace Laravel’s event system. You’ll need to explicitly adopt its event-sourcing model, which may require custom listeners or hybrid approaches. Avoid mixing it with Laravel’s synchronous `Event` facade unless you handle conflicts via middleware or adapters.
What Laravel versions are officially supported, and are there PHP 8.4 compatibility issues?
The package supports Laravel 10+ and PHP 8+. It has removed PHP 8.4 deprecations like `create_function`, but audit your Laravel ecosystem for hidden dependencies on these functions. Test with PHP 8.1+ features like constructor property promotion or named arguments in event handlers.
Can I use Eloquent models for aggregates, or does this package enforce raw SQL?
The package relies on raw SQL or non-Eloquent layers for performance and consistency. While you can use Eloquent for read models, aggregates should be persisted via the package’s API. Wrappers or adapters may be needed to bridge Eloquent queries with the package’s storage layer.
How does this handle transactions for event-aggregate consistency in Laravel?
The package assumes ACID compliance for event-aggregate pairs but requires manual transaction management in Laravel. Use database transactions in your event handlers or aggregate roots to ensure atomicity. For complex workflows, consider Laravel’s `DB::transaction()` or package-specific transaction helpers.
Is there built-in support for event replay or temporal queries in Laravel?
The package provides core event persistence but lacks Laravel-specific tooling like Scout for event search. Implement replayability via custom queries on the event table or use Laravel’s query builder to filter events by timestamp or aggregate ID.
What are the performance implications compared to Laravel’s native event system?
The package introduces overhead for event-sourcing patterns but optimizes for consistency. Benchmark against Laravel’s native system, especially for high-throughput apps. Consider caching read models or using Laravel’s queue system for async persistence if performance is critical.
Can this package work with multi-DB setups or sharding in Laravel?
The package doesn’t enforce multi-DB constraints but requires manual configuration for sharding. Use Laravel’s database connections or custom logic to route events to specific databases. Test thoroughly for consistency across shards, especially during failovers.
Are there alternatives for event-sourcing in Laravel that don’t require custom schema setup?
Alternatives like `spatie/laravel-event-sourcing` or `prooph/event-store` offer similar functionality but may integrate tighter with Laravel’s conventions. These packages often provide pre-built migrations or Eloquent models, reducing schema overhead compared to this package’s raw SQL approach.
How do I test event-sourcing logic in Laravel’s testing framework?
Use Laravel’s `Event::fake()` for mocking events, but extend it to verify persistence via the package’s API. For temporal tests (e.g., replay), manually seed events into the database or use Laravel’s `DatabaseMigrations` trait. Avoid relying on Laravel’s built-in event testing helpers for package-specific assertions.
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.
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
spatie/mailcoach-vapor