PHPackages                             palokankare/laravel-api-versions - 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. palokankare/laravel-api-versions

ActiveLibrary

palokankare/laravel-api-versions
================================

Implement date based versioning to Laravel Form Request and Resources for your API

10PHP

Since Jun 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/palokankare/laravel-api-versions)[ Packagist](https://packagist.org/packages/palokankare/laravel-api-versions)[ RSS](/packages/palokankare-laravel-api-versions/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Simple date based versioning to Laravel API Form Requests and Rerouces
======================================================================

[](#simple-date-based-versioning-to-laravel-api-form-requests-and-rerouces)

**THIS PACKAGE IS STILL IN DEVELOPMENT**

This Laravel package is a proof of concept and inspired of Stripe's [blog post about API versioning](https://stripe.com/blog/api-versioning)

Rather than having large major API versions (v1, v2, v3...) the updates are small and named with the date they are released. This package tries to solve issue when it comes breaking change in Laravel From Requests (for example validation rules) and Laravel Resources.

API resources are written so that the structure they describe is what we’d expect back from the current version of the API. When we need to make a backwards-incompatible change we release new date based API version that will describe how to revert the change.

Example of how versions and changes are described.

```
return [
                '2018-06-05' => [], // Latest version doesn't have any changes naturally. Doesn't have to be defined here.
                '2018-05-28' => [
                    'App\Http\Resources\BookResource' => 'App\Http\Resources\Changes\UpdatePublishedDate',
                    'App\Http\Requests\StoreBook'     => 'App\Http\Requests\Changes\\MakeAuthorNonMandatory',
                ],
                '2018-05-26' => [
                    'App\Http\Resources\BookResource' => 'App\Http\Resources\Changes\AddAuthor',
                    'App\Http\Resources\FooResource'  => 'App\Http\Resources\Changes\Bar',
                ],
        ];

```

### Installation

[](#installation)

Publish the config-file with:

```
php artisan vendor:publish --provider="Klopal\ApiVersions\ApiVersionsServiceProvider" --tag="config"
```

### Usage

[](#usage)

...

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Kalle Palokankare](https://github.com/palokankare)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e97250f77e703b9f72b8d3f5c3dde7c0ad56323a462fadad27937d63bf21945?d=identicon)[palokankare](/maintainers/palokankare)

---

Top Contributors

[![palokankare](https://avatars.githubusercontent.com/u/277939?v=4)](https://github.com/palokankare "palokankare (1 commits)")

### Embed Badge

![Health badge](/badges/palokankare-laravel-api-versions/health.svg)

```
[![Health](https://phpackages.com/badges/palokankare-laravel-api-versions/health.svg)](https://phpackages.com/packages/palokankare-laravel-api-versions)
```

PHPackages © 2026

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