Download the PHP package alsvanzelf/jsonapi without Composer

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

jsonapi Build Status Scrutinizer Code Quality Code Coverage

A simple and human-friendly library for api servers (php serving json).

It allows you to generate json output according to the JSON:API v1.1 standard, while being easy to understand for people without knowledge of the jsonapi standard.

The JSON:API standard makes it easy for clients to fetch multiple resources in one call and understand the relations between them. Read more about it at jsonapi.org.

Installation

Use Composer require to get the latest stable version:

The library supports, and is is tested on, php versions 5.6, 7 and 8.

Upgrading from v1

If you used v1 of this library, see UPGRADE_1_TO_2.md on how to upgrade.

Getting started

A small resource example

Which will result in:

A collection of resources with relationships

Which will result in:

Turning an exception into jsonapi

Which will result in:

This can be useful for development. For production usage, you can better construct an ErrorsDocument with only specific values.

Using extensions and profiles

The Atomic Operations extension and the Cursor Pagination profile come packaged along. Any 3rd party of self-made extension can be applied with:

Which will result in:

A similar flow can be used for profiles.

Other examples

Examples for all kind of responses are in the /examples directory.

Features

This library supports v1.1 of the JSON:API specification.

It has support for generating & sending documents with:

Also there's tools to help processing of incoming requests:

Next to custom extensions/profiles, the following official extensions/profiles are included:

Plans for the future include:

Contributing

If you use the library, please ask questions or share what can be improved by creating an issue.

For bugs issues or Pull Requests are welcome!

Licence

MIT


All versions of jsonapi with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-json Version *
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 alsvanzelf/jsonapi contains the following files

Loading the files please wait ....