Download the PHP package jeromejhipolito/laravel-api-versioning without Composer

On this page you can find all versions of the php package jeromejhipolito/laravel-api-versioning. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-api-versioning

Laravel API Versioning

Latest Version on Packagist License

Header-based API versioning with version flags for Laravel. Supports semantic versioning and feature flag-like version control.

Features

Installation

Publish Configuration (Optional)

Configuration

Add to your .env:

Edit config/api-versioning.php:

Register Middleware

In bootstrap/app.php:

Usage

Making Requests

Response Headers

Every response includes:

Check Version Status

Using in Controllers

Using in Resources

Disabled Version Response

When a version is supported but not enabled:

This allows mobile apps to check version_enabled and hide features accordingly.

Version Flags Workflow

  1. Add new version as supported but disabled

  2. Deploy to production - Old apps continue working

  3. Submit new app version - App checks version_flags and hides 2.0.0 features

  4. After app store approval - Enable the version

Minimum Version Middleware

Require a minimum API version for specific routes or groups:

Register the Middleware Alias

In bootstrap/app.php:

Usage

Response When Version Is Too Low

HTTP Status: 400 Bad Request

Available Methods

VersionAwareTrait (Controllers)

Method Description
getApiVersion() Get current version string
getApiMajorVersion() Get major version number
getApiMinorVersion() Get minor version number
getApiPatchVersion() Get patch version number
isVersionAtLeast($v) Check if >= version
isVersionBelow($v) Check if < version
isVersionExactly($v) Check if exact version
isVersionBetween($min, $max) Check if in range

VersionAwareResourceTrait (Resources)

Method Description
mergeWhenVersion($v, $array) Merge array if >= version
mergeWhenVersionBelow($v, $array) Merge array if < version
mergeWhenVersionExactly($v, $array) Merge array if exact version
mergeWhenVersionBetween($min, $max, $array) Merge if in range
whenVersion($v, $value, $default) Return value if >= version
whenVersionBelow($v, $value, $default) Return value if < version

License

MIT License. See LICENSE for details.


All versions of laravel-api-versioning with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/routing Version ^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jeromejhipolito/laravel-api-versioning contains the following files

Loading the files please wait ...