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

Php Api Version Bundle Laravel Package

ixnode/php-api-version-bundle

A lightweight PHP bundle for managing API versions across your application. It helps organize versioned endpoints, resolve the requested version from incoming requests, and maintain backward compatibility without cluttering your controllers. Simple to install and integrate.

View on GitHub
Deep Wiki
Context7

Getting Started

  • 0.1.29 is a maintenance release: it refreshes ixnode dependencies. No new features, deprecations, or breaking changes are documented, so treat it as a dependency-bump release and pin to ^0.1 until you have regression coverage.
  • Look first at README.md, composer.json, CHANGELOG.md, src/, tests/, and any DependencyInjection/ or service-provider files. The package is named as a “Bundle”, so verify its registration path before assuming Laravel auto-discovery.
  • Minimal setup: composer require ixnode/php-api-version-bundle:^0.1, register the service provider/bundle bridge if needed, publish config if supported, and clear Laravel’s config/route caches.
  • First use case: configure one supported API version and expose either a small /api/version endpoint or a version-gated route group. Verify the resolved version and response before adding multiple versions or negotiation rules.

Implementation Patterns

  • Keep supported versions, default version, and deprecated versions in config as the single source of truth.
  • In Laravel, wrap the package’s version resolver in middleware: parse Accept or X-Api-Version, validate against config, attach the resolved version to the request, and reject unsupported versions with a consistent error response.
  • Bind any package service into Laravel’s container explicitly rather than relying on Symfony-style container conventions.
  • Use a version endpoint to report current, supported, and deprecated versions from the same config used by middleware.
  • Prefer route groups per API version or version-aware controllers that delegate to version-specific actions. Avoid scattering version checks through controllers.
  • Add tests for default resolution, explicit version, invalid version, deprecated version, and fallback behavior.

Gotchas and Tips

  • This is a 0.x package: pin versions and run regression tests after dependency updates. 0.1.29 only updates ixnode packages, but transitive dependency changes can still affect behavior.
  • The “Bundle” naming may mean Symfony-style registration. In Laravel, confirm whether auto-discovery works or whether you need a manual provider/bridge.
  • Clear config and route caches after changing version configuration; stale caches can make middleware resolve old defaults.
  • Define header precedence and fallback rules explicitly: Accept vs X-Api-Version, default version, and unsupported-version behavior should be documented and tested.
  • Do not hardcode the “latest” API version in controllers; resolve it from config so future version additions do not require controller edits.
  • Debug with container resolution checks, php artisan route:list, and resolver logging. Useful extension points are usually a custom version resolver and response middleware/listener.
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