bugloos/api-versioning-bundle
Pros:
Symfony\Component\HttpKernel.Accept: application/vnd.api.v1+json) and URL-based (/v1/endpoint) versioning, addressing common API design needs.Route::prefix() or Symfony’s prefix()).Cons:
Illuminate\Pipeline compatibility).HttpKernelInterface).composer.json constraints).fruitcake/laravel-apiversioning (more stars, active maintenance)./api/*)?tests/Feature/Api/V1/ structure)?VersioningMiddleware in Laravel’s Handle class (e.g., extend Illuminate\Foundation\Http\Middleware).Route::prefix() for URL-based versioning or inject middleware globally via app/Http/Kernel.php.HttpKernelInterface (if needed) or use Laravel’s container directly.config/packages/bugloos_api_versioning.yaml./v1/users, /v2/users).Route::resource('users')).Accept: application/vnd.api.v1+json).Kernel.php or service providers./api/v1/orders) while keeping /api/v2 as a parallel branch.v3 requires new route definitions).RouteServiceProvider.version_resolver).app.debug to surface detailed middleware errors.Vary: Accept) may help CDNs serve versioned content.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Middleware throws unhandled error | 500 errors for all requests | Wrap middleware in try-catch |
| Version header malformed | 406 Not Acceptable | Validate headers in middleware |
Route conflict (e.g., /v1/users vs. /users) |
404 or incorrect version served | Use Route::prefix() explicitly |
| Bundle PHP 8.3+ incompatibility | Integration breaks | Fork and update dependencies locally |
Accept header tests).How can I help you explore Laravel packages today?