PHPackages                             iambib/api-version-fallback - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. iambib/api-version-fallback

ActiveLibrary[API Development](/categories/api)

iambib/api-version-fallback
===========================

A package that allows you to have a fallback version of your api

v1.0.4(1y ago)02.0k↓100%BSD-3-ClausePHPPHP &gt;= 8.0.2

Since Mar 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/iamBiB/api-versioning-fallback)[ Packagist](https://packagist.org/packages/iambib/api-version-fallback)[ Docs](https://github.com/iambib/)[ RSS](/packages/iambib-api-version-fallback/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

[![](https://camo.githubusercontent.com/b6e05ecb4621a0ef40b155b0d838ccc17ecdca8e60d52c89d29160c503bf7d5a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f69616d6269622f6170692d76657273696f6e696e672d66616c6c6261636b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/iambib/api-versioning-fallback/releases/latest)

Lumen Api Versioning
====================

[](#lumen-api-versioning)

A package that allows you to have a fallback version for your Lumen api

Description
-----------

[](#description)

This package allows you to have fallback versions for your api. Basically if you have v1 in place and you want to update your app to v2 but you don't have time to update all methods, this pack allows you to take a break. Eg. #1 **api.dev/v2/users** will fallback to **api.dev/v1/users** if v2 is not found Eg. #2 **api.dev/v3/users** will fallback to **api.dev/v2/users** if found, if not **api.dev/v1/users**

Installation
------------

[](#installation)

```
    composer require iambib/lumen-api-versioning
```

`config file`Create a config file named api-versioning.php and add the following lines

```
return [
    /**
     * Enable the fallback
     */
    'enable' => true,
    /**
     * Available api versions
     */

    'available_versions' => [
        'v1',
        'v2',
    ],
    /**
     * Set them in order you want the fallback to happen
     * Eg. If v4 is not found v3 is the first one to check if exists. If not, v2 then v1.
     */
    'api_fallbacks' => [
        'v3', 'v2', 'v1',
    ],
    /*
     * URL segment number of your api version
     */
    'segment_no' => 0,
];
```

`bootstrap/app.php`

```
	$app = new \iAmBiB\ApiVersionFallback\Extension\Application(
		$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
	);
 	...
   $app->middleware([
		...
		'api_versioning_fallback' => \iAmBiB\ApiVersionFallback\Middleware\ApiVersioningFallback::class,
	]);
	...
	$app->configure('api-versioning');
```

Support
=======

[](#support)

Hey dude! If you like it .. well [![beers](https://camo.githubusercontent.com/cfad5a164cc9dda21bbca1e83f53726fb2db29c5da944ec34a0a9e844e89981f/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f69636f6e732f656d6f6a692f756e69636f64652f31663337622e706e67)](https://camo.githubusercontent.com/cfad5a164cc9dda21bbca1e83f53726fb2db29c5da944ec34a0a9e844e89981f/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f69636f6e732f656d6f6a692f756e69636f64652f31663337622e706e67) or a [![coffee](https://camo.githubusercontent.com/5dbab2895c826dfbceb6f6661d7b3d04882cc0a26b969ea81888c45905af7443/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f69636f6e732f656d6f6a692f756e69636f64652f323631352e706e67)](https://camo.githubusercontent.com/5dbab2895c826dfbceb6f6661d7b3d04882cc0a26b969ea81888c45905af7443/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f69636f6e732f656d6f6a692f756e69636f64652f323631352e706e67) would be nice :D

[![coffee](https://camo.githubusercontent.com/e9aa2120403febc22384c319070cfa5c36d1849fa75fdb74c1dfe83a8c136ef2/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f626c61636b5f696d672e706e67)](https://www.buymeacoffee.com/fhc0C7A)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance50

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~255 days

Total

4

Last Release

399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/192c69fa4d5c5609f566b9e0f6eb0694f5ca3d70c57655189067a9b4dee8c34b?d=identicon)[iamBiB](/maintainers/iamBiB)

---

Top Contributors

[![iamBiB](https://avatars.githubusercontent.com/u/12171894?v=4)](https://github.com/iamBiB "iamBiB (8 commits)")

---

Tags

apilaravellumenversioning

### Embed Badge

![Health badge](/badges/iambib-api-version-fallback/health.svg)

```
[![Health](https://phpackages.com/badges/iambib-api-version-fallback/health.svg)](https://phpackages.com/packages/iambib-api-version-fallback)
```

###  Alternatives

[darkaonline/swagger-lume

OpenApi or Swagger integration to Lumen

3372.3M3](/packages/darkaonline-swagger-lume)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[shipu/php-aamarpay-payment

PHP client for Aamarpay Payment Gateway API

3214.6k](/packages/shipu-php-aamarpay-payment)[nilportugues/laravel5-json-api-dingo

Laravel5 JSONAPI and Dingo together to build APIs fast

311.5k](/packages/nilportugues-laravel5-json-api-dingo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
