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

Verbs Laravel Package

hirethunk/verbs

Verbs is a Laravel-friendly event sourcing package for PHP artisans that keeps the benefits of event sourcing while cutting boilerplate and jargon. Model behavior as verbs, record events, and build projections with a clean, approachable API.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Event-Driven Architecture (EDA) Adoption: Enables teams to transition from CRUD-based systems to event-centric workflows, reducing coupling and improving scalability. Ideal for domains like order processing, user onboarding, or real-time notifications where auditability and replayability are critical.
  • Auditability & Compliance: Supports regulatory requirements (e.g., GDPR, financial audits) by maintaining an immutable event log, eliminating "lost update" risks, and enabling point-in-time state reconstruction.
  • Build vs. Buy: Buy for teams lacking event-sourcing expertise or time to build a custom solution. Build only if needing deep customization (e.g., multi-DB support, non-Laravel integrations).
  • Real-Time Systems: Integrates with Livewire (per changelog) for reactive UIs, enabling features like collaborative editing or live dashboards without polling.
  • Microservices & Decoupling: Facilitates domain-driven design (DDD) by encapsulating business logic in verbs (actions) rather than nouns (models), easing microservice decomposition.
  • Testing & Debugging: Simplifies time-travel debugging (via event replay) and state validation, reducing flaky tests in complex workflows (e.g., payments, subscriptions).
  • Roadmap Priorities:
    • Phase 1: Pilot with a high-value, low-risk domain (e.g., user profiles).
    • Phase 2: Expand to core workflows (e.g., orders, inventory) with snapshot optimization.
    • Phase 3: Integrate with external systems (e.g., Kafka, WebSockets) via event listeners.

When to Consider This Package

Adopt If:

  • Your team uses Laravel and needs event sourcing without boilerplate (e.g., CQRS, audit logs).
  • You’re building stateful applications where history matters (e.g., financial systems, SaaS workflows).
  • You want to reduce coupling between services/components (e.g., replacing direct model updates with events).
  • Your stakeholders prioritize debuggability (e.g., "Why did this user get this discount?").
  • You’re using Livewire, Octane, or queues and need event consistency across async processes.
  • Your current architecture suffers from:
    • Race conditions in concurrent updates.
    • Spaghetti logic in model observers/accessors.
    • High maintenance due to manual event logging.

Look Elsewhere If:

  • You need multi-language support (Verbs is PHP-only).
  • Your events require complex distributed transactions (e.g., Saga patterns beyond Laravel’s boundaries).
  • You’re constrained by database limitations (e.g., no JSON support in legacy DBs).
  • Your team lacks PHP/Laravel expertise (steep learning curve for event-sourcing concepts).
  • You’re building serverless or edge-compute systems (package assumes Laravel’s request lifecycle).
  • You need off-the-shelf analytics (e.g., event-time windows, aggregations)—consider Kafka + Flink instead.

How to Pitch It (Stakeholders)

For Executives:

"Verbs lets us build more resilient, auditable systems without the complexity of traditional event sourcing. Think of it like Git for your application state: every change is an atomic ‘commit,’ and we can always ‘revert’ to any past version. This reduces bugs in high-stakes workflows (like payments or compliance logs) and makes debugging 10x faster. For example, if a user’s subscription fails, we can replay events to see exactly what went wrong—no more guessing. It’s a drop-in solution for Laravel, so we avoid reinventing the wheel, and it plays nicely with our existing stack (Livewire, queues). Early adopters like [hypothetical company] cut their audit-related dev time by 40%."

Ask:

  • "Would you prioritize reducing compliance risks or improving feature velocity first?"
  • "Are there workflows where ‘undo’ or ‘replay’ would save us money?"

For Engineers:

*"Verbs is a Laravel package that turns event sourcing from a ‘write a framework’ task into a ‘write verbs’ task. Here’s why it’s a game-changer for us:

  1. No More Boilerplate:

    • Define actions (verbs) like User::createProfile() instead of mutating models directly.
    • Automatically handles event storage, replay, and state snapshots.
  2. Debugging Superpowers:

    • Replay events to test edge cases (e.g., ‘What if this API call failed?’).
    • Time-travel debugging with verb()->replay().
  3. Scalable by Design:

    • Built-in concurrency guards prevent race conditions.
    • Snapshots optimize performance for large event histories.
  4. Laravel Native:

    • Works with Eloquent, Livewire, Queues, and Octane out of the box.
    • Example: Replace User::update(['status' => 'active']) with:
      User::verb()->activate();
      

Trade-offs:

  • Learning curve for event-sourcing concepts (but docs/examples are solid).
  • Requires discipline to avoid mixing verbs and traditional CRUD.

Proposal:

  • Start with a pilot domain (e.g., user onboarding) to validate the approach.
  • Use the verb() helper to wrap 1–2 critical workflows, then expand.
  • Leverage the built-in testing tools to reduce flaky tests in async workflows."*

Ask:

  • "Which part of our stack would benefit most from auditability/replayability?"
  • "Are there teams using Livewire/Octane we could align with for early adoption?"
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai