Download the PHP package lukepolo/laravel-api-migrations without Composer

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

Laravel API Migrations

Latest Version on Packagist Build Status StyleCI

This package is based on the API versioning scheme used at Stripe. Users pass a version header and you automatically migrate the request & response data to match the current version of your code.

TLDR

You can update your API without worrying of users applications breaking with API Migrations.

You write these incrementing migrations to convert your request/responses go back in time to allow your users applications to work flawlessly.

Features

How to use in day to day development

You should create releases (including your current release) when releasing your API. This allows the system to know how to migrate a request/response to and older version of the API.

For example :

Current Release V1 - 2017-08-31 expects the response :

Release V1 - 2017-08-01 expects the response :

When your users are using the older API they expect to see that secret title.

It will then migrate the request 2017-08-31 to 2017-08-01.

While this is a simple example you can see the power with these migrations to create simple steps to migrate your current version of the api to an older version of the API very easily.

Installation

Service Provider & Facade

This package supports Laravel 5.5 autoloading so the service provider and facade will be loaded automatically.

If you are using an earlier version of Laravel or have autoloading disabled you need to add the service provider and facade to config/app.php.

Middleware

Add the middleware to your Http Kernel app/Http/Kernel.php.

You have a couple of choices where to put this, recommenced under the api middleware!

Configuration

Run the following Artisan command to publish the package configuration to config/request-migrations.php.

Usage

Creating a Release

You can generate a new release using the Artisan CLI.

Creating a Migration

You can generate a new api migration using the Artisan CLI.

The command will generate a api migration and publish it to App/Http/ApiMigrations/V{VersionNumber}/Release_{YYYY_MM_DD}/{MigrationName}.

Caching Migrations

Once you move to prod you should cache the results

Making HTTP Requests

By default when making a request to your API it will not run any migrations.

To use a different version of your api just attach a header :

Writing the API migrations

migrateRequest method : This is used to convert your request to be valid to your most current route

migrateResponse method : This is used to convert your response to what you should expect for that version

Example : -- link to gist --

Versioning

You should use the artisan commands above to create releases, including your current release. You can also set your current versions in the config.

You can tag your current versions in your config by setting it up like this :

``### User Version Pinning With version pinning you can automatically keep users to that API and allow them to upgrade to your latest version at their convince. Once once your user hits your api for the first time it will set the most current version.

!!!! NOTE !!!!!

You must also make the column api_version fillable in your User model!

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CONTRIBUTING for details.

Security

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

License

The MIT License (MIT). Please see License File for more information.

Credits

This package was original idea build by Tom Schlick, but modified heavily.

https://github.com/tomschlick/request-migrations


All versions of laravel-api-migrations with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
illuminate/config Version 5.4.*|5.5.*
illuminate/contracts Version 5.4.*|5.5.*
illuminate/http Version 5.4.*|5.5.*
illuminate/support Version 5.4.*|5.5.*
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 lukepolo/laravel-api-migrations contains the following files

Loading the files please wait ....