silverbackis/api-component-bundle
A Symfony bundle for building modular JSON APIs with reusable components. It helps organize endpoints, handle requests and responses, and keep API code clean, testable, and easy to extend across your application.
components-web-app/api-components-bundle), not a Laravel package. There is no service provider or facade to register. You get value from it in one of two ways:
src/Entity (Component, ComponentGroup, positions/ownership), src/Security/Voter/ComponentVoter.php (authorization rules you'll be fighting), the bundle config for cache/purge settings, and — as of 2.0.0-alpha.30 — tests/Functional/. The Behat features/*.feature files are gone; the PHPUnit functional tests are now the authoritative, executable documentation of every endpoint's behavior.GET the rendered/read model → trigger the purge operation → confirm the cache is invalidated. That path exercises ownership, draft/published state, rendering, and the HTTP cache purge in one go.composer require components-web-app/api-components-bundle:2.0.0-alpha.30 (or run the matching Docker tag). Alphas of this bundle have changed validation semantics between releases; floating constraints will bite you.Http::baseUrl(...)->withToken(...), not raw Http:: calls scattered through controllers. Map 422 responses to form validation by reading the JSON property paths (component, components, etc.) rather than string-matching messages.components. Assigning a group an owner is a relation update on the group, and the new guard rejects it when the owner lives inside the group. Do ownership reassignment as an explicit step in your UX (pick group → pick owner → submit), and surface the components 422 as "that owner is inside this group," not a generic failure.tests/Functional/Fixture/scaffolds and assets to tests/Functional/assets. Point your local seeding script or your own integration tests at those scaffolds so your fixtures stay shaped like upstream's expectations.Http::fake() with recorded payloads from the real API; run a thin, nightly integration suite against a running instance. The bundle's own suite is PHPUnit-only now, so if you previously cribbed from the Behat .feature files in CI or docs, rewrite those references against tests/Functional/*Test.php.422 on component; giving a group an owner from inside it returns 422 on components. If your client currently posts these and ignores the result, you were silently corrupting the tree before and will now see hard failures. That's the good outcome — but handle both property paths explicitly.ComponentVoter no longer recurses forever on a cycle already in the database — it stops instead of blowing up. If you ran any earlier alpha, audit your tree for pre-existing cycles (a draft/published pair that contains its own group), because nothing will repair that data for you; it will just stop hanging.features/, features/assets, or features/scaffolds is now dead. New locations: tests/Functional/assets and tests/Functional/Fixture/scaffolds. The Behat-only PHP dependencies are also gone, so behat.yml and its extensions must be dropped.symfony/yaml and symfony/translation are now direct dev dependencies — if you vendor or fork the test suite, add them explicitly or autoloading/bootstrap will fail in non-obvious places.phpunit.xml into your own project means accidental output, missing assertions, or unused mocks fail the build. Useful strictness, surprising first run.jsonb, collation, or case-sensitivity behavior.component vs components) point at different layers of the write — one is the position's component, the other is the group's owner relation — and a single form submit can touch both.ComponentVoter. If you subclass or decorate it, keep your checks iterative rather than recursive over the component tree, for the same reason upstream had to fix their own recursion.How can I help you explore Laravel packages today?