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

Product Decisions This Supports

  • Event-Driven Architecture (EDA) Adoption: Enables seamless integration of Symfony’s EventDispatcher into Propel ORM models, allowing teams to adopt EDA patterns (e.g., pub/sub, hooks, or workflows) without reinventing event systems. Aligns with roadmaps for modular, loosely coupled systems.
  • Build vs. Buy: Avoids custom event-handling logic (e.g., manual triggers in models) by leveraging a battle-tested Symfony component, reducing technical debt.
  • Use Cases:
    • Audit Logging: Dispatch postSave/postDelete events to log changes via listeners.
    • Notifications: Trigger email/SMS alerts when model states change (e.g., OrderStatusUpdatedEvent).
    • Third-Party Integrations: Sync data to external APIs (e.g., Stripe, Salesforce) via events.
    • Validation Workflows: Chain validation logic across services via events (e.g., UserProfileUpdatedEvent → trigger KYC checks).
  • Legacy Modernization: Bridges older Propel 1.x systems to modern event-driven patterns without full framework migrations.

When to Consider This Package

  • Avoid If:
    • Using Propel 2.x+: This package targets Propel 1.x; modern alternatives (e.g., Symfony’s native event system or Propel 2 behaviors) may fit better.
    • Symfony Full-Stack: If already using Symfony, prefer its built-in EventDispatcher over this Propel-specific wrapper.
    • High Throughput Needs: Per-class dispatcher instances may introduce memory overhead for high-frequency operations (evaluate caching strategies).
    • Active Maintenance: Archived status (no commits since 2014) suggests limited long-term support; assess risk for critical systems.
  • Look Elsewhere If:
    • Need real-time events: Consider Laravel’s events + listeners or a message broker (e.g., RabbitMQ).
    • Microservices: Prefer language-agnostic event platforms (e.g., Kafka, NATS) for cross-service communication.
    • Type Safety: PHP 8+ users may prefer modern event libraries (e.g., symfony/event-dispatcher-contracts).

How to Pitch It (Stakeholders)

For Executives: "This package lets us add event-driven logic to our Propel models with minimal code—think of it like ‘hooks on steroids.’ For example, when a user updates their profile, we can automatically trigger notifications, sync data to third parties, or log changes—all without tight coupling. It’s a lightweight way to modernize legacy systems or add flexibility to new features, reducing the need for custom event infrastructure. The MIT license and Symfony’s backing ensure reliability, though we’d need to confirm it fits our Propel version."

For Engineers: *"This integrates Symfony’s EventDispatcher into Propel 1.x models via a behavior, giving us:

  • Decoupled logic: Dispatch events from models (e.g., user.save()UserSavedEvent) and handle them in listeners/services.
  • Reusable patterns: Standardize event names (e.g., preInsert, postUpdate) across the codebase.
  • Symfony compatibility: Uses the same event system as Symfony apps, easing future migrations. Trade-offs: Propel 1.x only, and the archived repo means no updates—but the core concept is sound. We’d need to test performance for high-traffic models and document event contracts clearly."*

For Developers: "Add this to your schema.xml and suddenly your Propel models can dispatch events like user.save()UserSavedEvent. No more manual if ($model->isDirty()) checks—just attach listeners to handle side effects (e.g., sending emails, updating caches). Docs are minimal, but the Symfony EventDispatcher is well-documented. Start with a single model to test the pattern before rolling it out."

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