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

Doctrine Api Client Laravel Package

bankiru/doctrine-api-client

Doctrine-style entity manager for remote RPC APIs. Map entities via YAML, register RPC clients, and use Doctrine Common interfaces (metadata, proxies, repositories) to fetch and manage remote resources as if they were Doctrine entities.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Unified Data Access Layer: Consolidates local database and remote API data into a single Doctrine ORM layer, enabling complex queries (e.g., JOIN-like operations) across heterogeneous data sources without manual API client code.
  • Microservices Orchestration: Simplifies communication between Laravel services by treating RPC endpoints as Doctrine entities, reducing boilerplate for inter-service calls (e.g., OrderService fetching Inventory data via API).
  • Legacy System Wrappers: Modernizes monolithic or legacy systems by exposing their RPC interfaces as Doctrine entities, allowing gradual migration to a service-oriented architecture.
  • Build vs. Buy Tradeoff: Avoids reinventing RPC client logic while maintaining consistency with Doctrine’s ecosystem (e.g., repositories, DQL, lazy loading). Ideal for teams already invested in Doctrine.
  • Use Cases:
    • API Aggregation: Fetch and normalize data from multiple third-party APIs (e.g., payment gateways, SaaS platforms) into a single Laravel application.
    • Hybrid Data Models: Combine local database records with remote API data in a single query (e.g., User entity with Profile from an external auth service).
    • Custom RPC Workflows: Extend beyond CRUD with domain-specific repository methods (e.g., bulkSync(), reconcile()) for API operations not covered by standard Doctrine patterns.
    • Headless CMS Integration: Treat API-driven content (e.g., Strapi, Contentful) as Doctrine entities for seamless integration with Laravel’s templating or admin panels.

When to Consider This Package

  • Adopt When:

    • Your application heavily uses Doctrine ORM and you want to extend its capabilities to remote APIs without duplicating client logic.
    • You need lazy-loaded relationships across API boundaries (e.g., fetching nested resources only when accessed).
    • Your RPC APIs are stable and well-defined, with minimal risk of schema changes (the package lacks dynamic contract adaptation).
    • You require type safety for API responses, leveraging Doctrine’s field types to validate and cast remote data automatically.
    • Your team has Doctrine expertise and can maintain custom repositories, field types, or RPC clients.
    • You’re building a microservices architecture where services communicate via RPC, and you want to abstract the complexity behind Doctrine entities.
  • Look Elsewhere If:

    • Your APIs are REST/gRPC-based (this package is RPC-only). Consider Symfony’s HttpClient + custom DTOs or API Platform.
    • You need real-time updates or WebSocket support (this package is synchronous and RPC-focused).
    • Your APIs are highly dynamic (frequent schema changes) or lack clear contracts. Tools like OpenAPI generators or GraphQL clients may be better suited.
    • You’re not using Doctrine ORM or have limited PHP/Laravel resources to maintain custom configurations (YAML metadata, repositories).
    • You require embeddable entities or advanced Doctrine features (e.g., inheritance mapping, change tracking).
    • Active maintenance is critical; the package is abandoned (last release: 2017) with no dependents.
    • Your team lacks Doctrine ORM experience, as the package introduces complexity (custom repositories, type registries, lazy-loading quirks).

How to Pitch It (Stakeholders)

For Executives: "This package lets us treat remote APIs like database tables—using Doctrine ORM to fetch, query, and relate data from external services as if it were local. For example, we could pull product data from a third-party API and join it with our inventory in a single query, without writing custom API clients. This reduces integration complexity, speeds up development for microservices, and eases modernization of legacy systems. The trade-off is higher upfront setup (Doctrine configuration) and reliance on stable API contracts. Given our existing use of Doctrine, this could save significant development time for API-heavy features."

For Engineers: *"If you’re already using Doctrine ORM and want to avoid writing repetitive API clients, this package lets you define RPC endpoints in YAML and access them via Doctrine repositories (e.g., $entityManager->getRepository(Product::class)->findBy([...])). Key benefits:

  • Lazy loading: Fetch related API data only when needed (e.g., product->supplier triggers a separate API call).
  • Custom methods: Extend repositories with API-specific logic (e.g., bulk imports, complex queries).
  • Type safety: Map API responses to Doctrine field types automatically (e.g., string, int).
  • Unified queries: Write DQL-like queries across local and remote data (e.g., WHERE t.payload LIKE '%sample%').

Downsides:

  • Outdated: Last release in 2017; may require PHP/Doctrine shims for modern Laravel.
  • RPC-only: Not suitable for REST/gRPC or real-time APIs.
  • Complex setup: Requires YAML configs, custom repositories, and Doctrine expertise.
  • No embeddables: Can’t nest complex objects like Doctrine embeddables.

Use it for:

  • Microservices communicating via RPC.
  • Wrapping legacy RPC systems in a modern ORM layer.
  • Projects where Doctrine is already the primary data access tool.

Avoid it for:

  • Dynamic APIs or REST/gRPC services.
  • Greenfield projects without Doctrine experience.
  • Teams needing active maintenance or modern PHP features."*
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.
terminal42/code-quality-tools
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