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
Propel Eventdispatcher Behavior

Propel Eventdispatcher Behavior Laravel Package

willdurand/propel-eventdispatcher-behavior

Propel behavior that integrates Symfony’s EventDispatcher into your model classes. Add it to your Propel config and schema to auto-generate an EventDispatcher per ActiveRecord class via getEventDispatcher(), enabling event-driven hooks in models.

View on GitHub
Deep Wiki
Context7

Integrates the Symfony2 EventDispatcher component in your Model classes.

Frequently asked questions about Propel Eventdispatcher Behavior
Can I use this package with Laravel’s Eloquent ORM?
No, this package is designed exclusively for Propel1 ORM. Laravel primarily uses Eloquent, so this package is only relevant if your application relies on Propel1. If you’re using Eloquent, Laravel’s built-in event system (e.g., `Event::dispatch()`) is a better fit.
How do I install this package in a Laravel project?
Add the package to your `composer.json` under `require` with the version you need (e.g., `willdurand/propel-eventdispatcher-behavior:dev-master`). Then configure `propel.ini` or `build.properties` to point to the behavior class and add `<behavior name="event_dispatcher" />` to your `schema.xml` for each model requiring events.
Will this package work with Laravel 10 or newer?
This package is archived and may not be compatible with newer Laravel versions due to dependencies on older Symfony and Propel1 versions. Test thoroughly in a staging environment, and consider alternatives like Laravel’s native event system or a message queue if compatibility issues arise.
How do I bridge Symfony events to Laravel’s event system?
You’ll need to manually synchronize the two systems. For example, create a Laravel service provider to listen for Propel events via `getEventDispatcher()` and dispatch equivalent Laravel events. This requires custom logic to map Symfony events to Laravel’s `Event` facade or `Bus` for commands.
Does this package support event listeners or subscribers?
Yes, the package integrates Symfony’s `EventDispatcher`, which supports both listeners and subscribers. You can attach listeners to Propel model events using the standard Symfony `addListener()` or `addSubscriber()` methods on the dispatcher instance returned by `getEventDispatcher()`.
Is there a performance impact from using this package?
Yes, each Propel model class will instantiate its own `EventDispatcher`, which can increase memory usage compared to Laravel’s centralized event system. If performance is critical, consider using Laravel’s native events or a lightweight queue system instead.
How do I test event propagation between Propel and Laravel?
Write integration tests that trigger Propel model events and verify they dispatch the correct Laravel events. Mock the `EventDispatcher` or use Laravel’s `Events::fake()` to assert events are fired as expected. Test both direct dispatches and bridged events between the two systems.
Are there alternatives to this package for event-driven Propel models?
If you’re using Propel1, you could manually integrate Symfony’s `EventDispatcher` without this behavior or use Laravel’s `Event` facade directly in Propel models (if possible). For modern Laravel apps, consider migrating to Eloquent or using Laravel Queues for decoupled event handling.
Will this package work with Propel2 or later versions?
No, this package is designed for Propel1 only. Propel2 introduced significant changes, and this behavior is not compatible. If you’re using Propel2, explore other solutions like custom event listeners or Laravel’s native event system.
How do I handle conflicts between Symfony and Laravel’s event systems?
Avoid duplication by explicitly bridging the two systems. For example, dispatch Laravel events from Propel listeners or vice versa, but don’t let both systems handle the same logic independently. Document your event flow to prevent inconsistencies, especially in production.
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.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony
spatie/flare-daemon-runtime