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 Data Laravel Package

event-engine/php-data

Immutable PHP value objects and data containers for event-driven apps. Provides typed properties, casting, validation, and convenient hydration from arrays/JSON, plus serialization back to payloads—useful for messages, commands, events, and read models in Event Engine setups.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Immutable Event Modeling: Strengthens event-driven architectures (e.g., CQRS, event sourcing) by adding native JSON serialization support, ensuring seamless interoperability with APIs, databases (e.g., MongoDB), and message brokers (e.g., Kafka, RabbitMQ). Reduces friction in cross-service communication by standardizing event payloads.
  • Roadmap Acceleration: Eliminates manual JSON serialization/deserialization boilerplate for events, accelerating development of real-time systems (e.g., WebSocket payloads) and microservices where events must be both type-safe and JSON-compatible.
  • Build vs. Buy: Replaces ad-hoc JSON handling (e.g., json_encode($event->toArray())) with a batteries-included solution, avoiding reinvention while supporting Laravel’s ecosystem (e.g., Illuminate\Broadcasting).
  • Use Cases:
    • Event Sourcing: Persist immutable events as JSON in storage (e.g., PostgreSQL JSONB, DynamoDB).
    • API-Driven Events: Expose events as REST/gRPC payloads with guaranteed structure.
    • Serverless/Event-Driven Workflows: Trigger AWS Lambda/Cloud Functions with pre-validated JSON events.

When to Consider This Package

  • Adopt if:
    • Your events must be JSON-serializable (e.g., for APIs, databases, or message queues) and require immutability/validation.
    • You’re using Laravel/PHP and need a unified approach for both domain events and HTTP/broker payloads.
    • Your team values developer experience: No need to manually implement JsonSerializable or Arrayable interfaces.
  • Look elsewhere if:
    • Your events are internal-only (e.g., in-memory event buses) and never leave the PHP process.
    • You’re using a non-PHP stack (e.g., Node.js, Go) where native JSON handling is preferred.
    • You require custom JSON schemas (e.g., JSON Schema validation) beyond what the package provides (consider pairing with spatie/laravel-json-validator).

How to Pitch It (Stakeholders)

To Executives: "This update adds native JSON serialization to our event objects, letting us standardize how events are exchanged across services, APIs, and databases—without sacrificing type safety. For example, a PaymentProcessed event can now be stored in PostgreSQL and sent to Kafka with zero manual conversion. It’s a 20% productivity boost for event-heavy features like our new real-time dashboard, while reducing bugs from malformed payloads."

To Engineering: *"v2.1.0 adds JsonSerializable support, so events like OrderShipped can now be used directly in:

$payload = json_encode($event); // No ->toArray() needed!

This works out of the box with Laravel’s Broadcast channels, API responses, and even raw JSON storage. Under the hood, it’s still immutable and validated—just more flexible. If you’re already using the package, this is a drop-in upgrade; if not, it’s another reason to adopt it for JSON-heavy workflows."*

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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
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