Download the PHP package ahmedessam/api-versionizer without Composer

On this page you can find all versions of the php package ahmedessam/api-versionizer. 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 api-versionizer

API Versionizer

API Versionizer is a versatile package for managing API versioning in Laravel applications. It supports flexible routing, automatic versioning, and deprecation notices, ensuring smooth transitions between API versions while maintaining backward compatibility.

Installation

You can install the package via Composer:

Usage

Step 1: Publish Configuration File

Before using the API Versionizer package, you must publish the configuration file using Laravel's built-in command:

This will create a configuration file named api-versionizer.php in your config directory. The configuration file contains the following options:

Step 2: Configure API Versions

Once the configuration file is published, you can configure the API versions by editing the api-versionizer.php file. You can specify the current version, fallback version, versioning strategy, versioning key, prefix, default version, default directory, versioned folders, middlewares, default files, and supported versions.

Here is an example configuration for API versioning:

In this example, we define a version v1 with a description and status. We also specify versioned files with their names, aliases, prefixes, namespaces, and middlewares.

Note: You can add as many versions and files as needed to support your API versioning requirements, status in the vesions array can be active or inactive or deprecated to indicate the status of the version.

Step 3: Run Versionizer Command

After configuring the API versions, you can run the Versionizer command to generate versioned routes and files automatically:

This command will create versioned routes and files based on the configuration specified in the api-versionizer.php file. It will generate routes for each versioned file with the appropriate version prefix and middleware.

Step 4: Access Versioned Routes

Once the versioned routes are generated, you can access them using the version prefix in the URL. For example, to access the users route in version v1, you can use the following URL:

This URL has the version prefix v1 and the route prefix users specified in the configuration file.

Handle Deprecation Notices

If you need to deprecate a version of the API, you can update the version status to deprecated in the configuration file and set deprecated_at to the date when the version will be deprecated. The Versionizer package will automatically handle deprecation notices and will return error when accessing a deprecated version.

Copy Version to New Version

If you need to copy a version to a new version, you can run the following command:

This command will copy the version v1 to version v2 and will generate the versioned routes and files for the new version based on the existing version, and namespace will be updated to the new version.

Delete Version

If you need to delete a version, you can run the following command:

This command will delete the version v1 and will remove the versioned routes and files for the specified version.

Features

Requirements

License

The API Versionizer package is open-source software licensed under the MIT license.

Author

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues

If you find any issues with the package or have any questions, please feel free to open an issue on the GitHub repository.

Enjoy using the API Versionizer package in your Laravel applications! 🚀


All versions of api-versionizer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^10.0|^9.0|^8.0
illuminate/console Version ^11.0|^10.0|^9.0|^8.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 ahmedessam/api-versionizer contains the following files

Loading the files please wait ....