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

Apibundle Laravel Package

ops-talent/apibundle

ops-talent/apibundle is a Laravel/PHP package for organizing API endpoints into a reusable bundle, helping teams keep routes, controllers, and responses consistent while centralizing API logic and reducing duplication across Laravel applications.

View on GitHub
Deep Wiki
Context7

Getting Started

Before writing any code, verify this package is actually the right tool: last release was July 2019, it has a single GitHub star and zero dependents, and it targets the Symfony 3.x/4.x era (FOSUserBundle/FOSOAuthServerBundle style OAuth2 wiring). On any current Symfony (5.4+, 6.x, 7.x) expect dependency resolution failures before you even reach composer install. If you're on a Laravel codebase, note that this is a Symfony bundle, not a Laravel package — there is no service provider, no config publishing, and nothing designed for Eloquent. You would be integrating it as a sidecar, not as a Composer library.

Minimal steps if you are committed:

  1. Clone the repo and read composer.json first — it is the fastest way to see the pinned Symfony/FOS versions and whether your project can even satisfy them.
  2. Read the bundle class (*Bundle.php) and DependencyInjection/ — this tells you which services, listeners, and config keys are auto-registered. There is no README-level documentation worth relying on; the DI extension is your spec.
  3. Inspect Controller/, Entity/, and Resources/config/ to find the REST resource pattern and the security/voter wiring for OAuth2.
  4. Confirm the OAuth2 dependency actually exists in your stack (it will almost certainly be friendsofsymfony/oauth-server-bundle, which is itself abandoned). If not, this bundle provides no usable auth on its own.

First use case: stand up one read-only endpoint (e.g. GET /api/items) using whatever controller base class or resource convention the bundle ships, behind the bundle's security config, to prove the wiring works end-to-end before you invest in writes, pagination, or token issuance.

Realistically, the first use case for most teams is: read it as a reference implementation for how to structure a RESTful API with OAuth2 in Symfony, then reimplement the parts you need against maintained packages (lexik/jwt-authentication-bundle, nelmio/api-doc-bundle, API Platform). Treat it as a teaching artifact, not a dependency.

Implementation Patterns

The bundle follows the classic Symfony "API bundle" shape, so the patterns you'll see are:

  • Controller-per-resource with a shared base or trait handling list/show/create/update/delete, serialized via JMSSerializer or Symfony's serializer. Follow the same convention rather than inventing a new one inside the bundle's routes.
  • Config-driven resource registration in config/packages/*.yaml under the bundle's root key. Keep all of your bundle config in one dedicated file (e.g. config/packages/opstalent_api.yaml) — the DI extension is the only reliable documentation you'll have, so you want it isolated and diffable.
  • OAuth2 grant flows wired through the security firewall. The pattern is a oauth2 firewall with a token endpoint, resource-server protection on the API firewall, and (typically) a password or client-credentials grant for machine clients. If you're adapting this to a modern app, map those grants onto JWT: client-credentials → lexik/jwt with a machine user, password grant → discouraged, prefer authorization-code + PKCE.
  • Serialization groups on entities to control which fields leak through the API. The bundle-era pattern relies heavily on JMS groups; if you port the idea forward, the equivalent is Symfony Serializer #[Groups] attributes plus #[Ignore] on anything sensitive.
  • Versioned routes (/api/v1/...) — copy this even if you drop the bundle. It's the one cheap decision from this era worth keeping.
  • Integration tip: if you must run it alongside a modern Symfony app, isolate it in a separate kernel or a separate service (a small PHP service you proxy to), rather than letting its pinned dependencies fight your main composer.json.

A safe workflow if you're mining it: extract entity → extract controller patterns → extract security firewall config → replace the abandoned OAuth2 lib with JWT → add OpenAPI via nelmio/api-doc-bundle. That sequence gives you a working API with the same shape and none of the dependency risk.

Gotchas and Tips

  • Abandonment is the headline gotcha. No commits since 2019, one star, zero dependents means no security patches, no CVE triage, no Symfony 5+/PHP 8 compatibility. Any OAuth2 code you ship from this carries real auth risk. Budget for a reimplementation, not a rescue.
  • Transitive FOS dependency. The OAuth2 layer almost certainly depends on friendsofsymfony/oauth-server-bundle, which is itself abandoned and was superseded by league/oauth2-server / oauth2-server-bundle. Check composer.lock after install; if FOS is in there, you have two unmaintained libs, not one.
  • No meaningful docs. Debugging means reading the DI extension, the routing YAML under Resources/config/, and the security config. Use bin/console debug:router, debug:container --tag=..., and debug:config <bundle_alias> to see what the bundle actually registered — these three commands will save you hours.
  • Silent no-op config. Symfony bundles from this era often ignore unknown config keys. If a setting "does nothing," confirm it's actually declared in Configuration.php (->children()->scalarNode(...)), not just present in a YAML file you copied from a blog post.
  • Firewall ordering. OAuth2 firewalls in this generation are order-sensitive; putting api before oauth_token (or vice versa) produces 401s that look like token bugs. Check security.yaml ordering first when tokens mysteriously fail.
  • Serializer surprises. JMS groups misconfiguration is the classic leak: fields with no group silently serialize (or fail to) depending on version. Add an explicit test that asserts the exact JSON shape of a resource — that's your regression net.
  • Extension points worth stealing even if you drop the bundle: the resource-per-controller convention, the v1 route prefix, the serializer-group discipline, and the "security firewall owns auth, controllers own data" separation. Those are cheap and portable; the concrete code is not.
  • Verdict for day-to-day work: do not add this as a dependency to a new or active project. Use it as a reference, and pick maintained alternatives (API Platform or a hand-rolled Symfony controller layer + lexik/jwt-authentication-bundle + nelmio/api-doc-bundle). If you're on Laravel, the equivalent stack is Laravel Sanctum or Passport + API Resources + Scribe — this bundle offers you nothing there.
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.
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
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect