Download the PHP package origami/api without Composer

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

Origami API Package

This package simplifies the process of setting up an API using Laravel 6. Many of the practices utilised in this package are courtesy of Build APIs you Won't Hate by Phil Sturgeon.

Installation

Install this package through Composer.

composer require origami/api

Requirements

This package is designed to work with Laravel >= 6 currently.

Configuration

There are some API configuration options that you'll want to overwrite. First, publish the default configuration.

This will add a new configuration file to: config/api.php.

keys

This is the valid list of API keys that authenticate requests. By default we support an environment variable of API_KEY which you can set in your .env file.

Middleware

This package includes two Middleware classes for Laravel 6

Origami\Api\Middleware\AuthenticateApiKey

The AuthenticateApiKey Middleware is designed to guard Api routes against unauthorised access. We recommend you include it on all routes as follows, unless you have a public API.

Controllers

We provide a helpful ApiController base controller class that includes a response method, allowing you to return json responses or get access to the Origami\Api\Response class which offers a variety of helpers methods.

Responses

The Origami/Api/Response class offers a variety of helper methods and ultimately uses the Illuminate\Contracts\Routing\ResponseFactory Laravel class to return a json response with appropriate headers.

You can use the API Response class in your controller by using the response helper method:

or

Items or Collections

We make use of the excellent league/fractal PHP package to parse and transform Eloquent models and collections. For more information visit fractal.thephpleague.com

There are three helper methods on the response object

Full Example

Routes: app/Http/routes.php

Controller: app/Http/Controllers/Api/Items.php

Transformer: app/Items/ItemTransformer.php

License

View the license


All versions of api with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0.2
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/contracts Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/http Version ^6.0|^7.0|^8.0|^9.0|^10.0
league/fractal Version ^0.19
nesbot/carbon Version ^2.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 origami/api contains the following files

Loading the files please wait ....