Weave 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

Api Bundle Laravel Package

ongr/api-bundle

Symfony bundle for exposing ONGR Elasticsearch documents through a configurable REST API. It provides routing, serialization, and endpoint configuration to build search and CRUD APIs with less boilerplate.

View on GitHub
Deep Wiki
Context7

The ONGR API Bundle provides a configurable REST API layer for Symfony applications, making it easier to expose application data and services through clean, consistent endpoints. Designed to fit the ONGR ecosystem, it helps teams build API-driven backends without hand-wiring every route and response.

  • Configurable endpoints for exposing resources through Symfony routing
  • Structured responses with serialization-friendly output
  • Extensible architecture for custom controllers, filters, and business logic
  • Symfony integration that works with existing bundles and service configuration
Frequently asked questions about Api Bundle
Can I use ongr/api-bundle in a Laravel application?
No. ongr/api-bundle is a Symfony bundle that depends on Symfony's bundle registry, DependencyInjection configuration tree, compiler passes, and event dispatcher. Laravel has no equivalent extension points, so there is no adapter path short of embedding a Symfony micro-kernel inside Laravel, which is a well-known anti-pattern. The practical answer is to reimplement the behavior with Laravel primitives instead.
Does ongr/api-bundle support Laravel 10, 11 or 12?
No. The bundle's last release is from 2016 and targets PHP 5.5 through 7.x with Symfony 2.7 and 3.0-era components. Modern Laravel versions pin Symfony 6 and 7 components, so the Composer constraint sets are disjoint. Installation would require --ignore-platform-reqs and manual patching of transitive dependencies before any glue code is written.
What does ongr/api-bundle actually do?
It is a Symfony bundle that exposes Elasticsearch data through a REST API, providing endpoints for search and document management. It is designed to plug the ONGR Elasticsearch bundles into API-driven Symfony applications. Its core value is a thin API and serialization layer over Elasticsearch rather than any unique search engine functionality.
Is ongr/api-bundle still maintained?
Effectively no. The last release dates to April 2016, and the project has roughly eight GitHub stars, zero dependents, and no active community to escalate issues to. That means no security patches across the entire transitive dependency tree, including the serializer, HTTP kernel, and Elasticsearch client. Adopting it means owning a fork indefinitely.
Why does Composer fail to install ongr/api-bundle alongside a modern Laravel app?
Composer resolves a dependency graph, and this bundle's PHP and Symfony constraints conflict directly with what Laravel 10, 11 and 12 require. Its Symfony 2.7 and 3.0-era components are incompatible with the Symfony 6 and 7 packages Laravel pins. Forcing resolution with --ignore-platform-reqs leads to runtime failures rather than a working install.
What is the Laravel-native alternative for Elasticsearch-backed REST endpoints?
Use laravel/scout with the Elasticsearch driver, or a thin wrapper over the official elasticsearch/elasticsearch client if you need lower-level control. Expose results with Route::apiResource and invokable controllers, shape responses with JsonResource and ResourceCollection, and paginate with LengthAwarePaginator. Filtering maps cleanly onto query scopes. This covers the same surface a team would get from the bundle in a fraction of the effort.
Can I port ongr/api-bundle code into a Laravel package?
Port the intent, not the code. Read the bundle's controllers, serialization configuration and DI definitions, then write a short spec of its request and response contract covering routes, filters, pagination and error shapes. Implement that spec with Laravel primitives and lock it down with HTTP-level tests. The extracted contract is the only durable artifact worth carrying forward.
How should I test a Laravel reimplementation of ongr/api-bundle behavior?
Write contract tests first. Encode the extracted request and response spec as HTTP-level feature tests using PHPUnit or Pest, asserting status codes, payload shapes, pagination metadata and error formats. These tests protect you during a parallel run or feature-flagged cutover. They also document the behavior for future maintainers far better than the original Symfony code.
Is ongr/api-bundle safe for production in a Laravel stack?
No. An eight-year-old unmaintained dependency means no security patches across its serializer, HTTP kernel and Elasticsearch client dependencies. There is also no community or downstream ecosystem to validate against, so regressions go unnoticed. For production, treat the bundle as an architectural reference only and build on maintained first-party packages.
Can I run a Symfony bundle inside Laravel using a micro-kernel?
Technically you can boot a Symfony micro-kernel inside a Laravel application, but it doubles boot cost and creates two competing containers, two dispatchers and two configuration systems. You also inherit the bundle's full dated Symfony dependency graph. The effort is unbounded and the reward is a thin API layer Laravel can reproduce natively in days, so this approach is not recommended.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource