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

On this page you can find all versions of the php package shahghasiadil/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 Total Downloads License

Attribute-based API versioning for Laravel, with version detection, deprecation metadata, versioned resources, and route inspection commands.

Requirements

Installation

You can install the package via composer:

Publish the config file:

Quick Start

1. Configure supported versions

Edit config/api-versioning.php:

2. Apply middleware to API routes

api.version middleware alias is registered by the package.

3. Add version attributes to your controller

4. Call your API with a version

Features

Attributes

ApiVersion

Use on a controller or method.

MapToApiVersion

Use on a method to map it to specific versions.

ApiVersionNeutral

Marks controller/method as version-neutral (available in all supported versions).

Deprecated

Add deprecation metadata to controller/method.

Response Headers

When middleware is active, responses can include:

Versioned Resources

VersionedJsonResource

Extend VersionedJsonResource and implement toArrayDefault(). Then optionally add version-specific methods (toArrayV1, toArrayV11, toArrayV2, toArrayV21) or custom mappings via config.

VersionedResourceCollection

Extend VersionedResourceCollection for version-aware list payloads.

Version Comparison Helpers

In controllers/resources using HasApiVersionAttributes:

Direct service usage:

Error Format (RFC 7807)

Unsupported versions return application/problem+json:

Optional documentation is included when api-versioning.documentation.base_url is set.

Artisan Commands

Generate controller stub with attributes:

Inspect routes and versions:

Check configuration health:

Show config overview:

Clear attribute cache:

Testing Helpers

Use ShahGhasiAdil\LaravelApiVersioning\Testing\ApiVersionTestCase in package/app tests.

Available helpers include:

Configuration Reference

Main file: config/api-versioning.php

Environment variables:

Development

Run tests:

Run static analysis:

Format code:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

If you discover any security-related issues, please email [email protected].

Credits

License

The MIT License (MIT). Please see LICENSE.md for details.


All versions of laravel-api-versioning with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.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 shahghasiadil/laravel-api-versioning contains the following files

Loading the files please wait ...