theofidry/loopback-api-bundle
A Symfony bundle for building LoopBack-style REST APIs, helping you expose application resources through configurable endpoints. It streamlines model-driven routing and integration, making it easier to add JSON-friendly API endpoints to Symfony apps with less boilerplate.
Architecture fit. Despite the "Laravel/PHP package" framing, this is a Symfony bundle, not a Laravel package. It registers via a Symfony Bundle class, wires services through the Symfony DI container, and hooks into Doctrine ORM's QueryBuilder plus DunglasApiBundle (the pre-1.0 name of what became API Platform). It implements LoopBack-style filter[where][field][gt]=... query-string parsing on top of Doctrine. There is no ServiceProvider, no facade, no Eloquent integration — so for a Laravel codebase the architectural fit is effectively zero. Even in Symfony, it targets a stack (Symfony 2.x/3.x + Doctrine ORM 2.4/2.5 + DunglasApiBundle 1.x) that was superseded in 2016 when DunglasApiBundle was renamed and re-architected into API Platform.
Integration feasibility. Low as a dependency. composer require theofidry/loopback-api-bundle will fail or force-degrade a modern project: the package pins PHP 5.5–7.x-era constraints, symfony/symfony ~2.7/3.0, and dunglas/api-bundle, all of which conflict with PHP 8.1+, Symfony 5.4/6/7, and api-platform/core 2.x/3.x. It is also deprecated and archived, so there is no path to a supported install. The genuinely reusable asset is the idea and roughly a few hundred lines of filter-parsing logic: translating a nested LoopBack filter document into a constrained query. That is small enough to re-implement or lift under the MIT license.
Technical risk. High on every axis:
Key questions for the requestor.
filter[where]), or can the API surface be redesigned?SearchFilter, RangeFilter, OrderFilter, and QueryParameter filters likely cover 80–100% of the need with zero custom code.Stack fit. Treat this as reference material, not a dependency. For a Laravel target, the concept maps to Eloquent query scopes or a dedicated FilterParser service that validates and applies where/order/limit/offset/include clauses against a query builder. The package's source is a useful Rosetta Stone for the LoopBack filter grammar and its edge cases (nested and/or, operator aliases like gte/lte/like/inq, relation traversal), but none of its classes are drop-in usable.
Migration path. Three viable routes, in descending order of preference:
Compatibility. Assume incompatible with any supported stack today: PHP ≥ 8.1, Symfony ≥ 5.4, Doctrine ORM ≥ 2.14, API Platform ≥ 2.6. Do not attempt --ignore-platform-reqs installs; the failures will be runtime, not just resolver-time, and will surface in production rather than CI.
Sequencing.
Maintenance. If adopted, you become the maintainer — of the package, of its dead upstream, and of the PHP-5-era transitive graph. There is no upstream to merge fixes from. Forking shifts a zero-maintenance "use a library" decision into an indefinite ownership commitment for a filter parser, which is a poor allocation of engineering time relative to writing ~300 lines yourself.
Support. No vendor, no maintainer, no issue triage, no security advisories. Internal engineers cannot escalate. Onboarding docs are a 2015 README tied to a framework name that no longer exists, so tribal knowledge will not exist either.
Scaling. The parsing itself is cheap; the risk is query shape. Unbounded LoopBack filters can express deep include graphs and arbitrary nested predicates, which translate into expensive joins, N+1 loads, and unbounded result sets. Any implementation must enforce: allow-listed filterable fields, allow-listed operators, max filter depth, mandatory pagination caps, and query-cost logging. Note that the original package predates most of these hardening patterns.
Failure modes.
Ramp-up. The codebase is small, so reading it is quick; the cost is contextual — an engineer must also learn DunglasApiBundle 1.x conventions, Doctrine ORM 2.4-era event subscribers, and LoopBack's filter grammar to make sense of it. Realistically half a day to read, several days to safely port. That is acceptable for a one-time extraction exercise and unacceptable as ongoing operational surface.
Recommendation. Do not adopt as a dependency. Treat it as a specification artifact for LoopBack filter semantics, confirm whether the underlying need is served by API Platform's native filters or a small Laravel query-scope layer, and route any genuine syntax-compatibility requirement through a short, owned, allow-listed re-implementation under the same MIT terms.
How can I help you explore Laravel packages today?