Download the PHP package wizards/rest-api without Composer
On this page you can find all versions of the php package wizards/rest-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download wizards/rest-api
More information about wizards/rest-api
Files in wizards/rest-api
Download wizards/rest-api
More information about wizards/rest-api
Files in wizards/rest-api
Vendor wizards
Package rest-api
Short Description A set of services to help you create beautiful REST APIs
License MIT
Package rest-api
Short Description A set of services to help you create beautiful REST APIs
License MIT
Please rate this library. Is it a good library?
Informations about the package rest-api
Wizards Technologies' PHP REST API Library
A framework agnostic PHP library based on fractal to help you craft beautiful REST APIs.
Goals
The main goal is to provide an easy to use and powerful REST API library that seamlessly integrates with modern frameworks.
The paradigm reads as follow:
- A method will ask for a given resource (usually a controller), sending over an http request that we Parse to find standardized parameters. A resource is a data object, that you can fetch from a data store - as a collection or as an entry. Thoses resources can have relationships, can be filtered, can be modified, ....
- The library will fetch the resource(s) according to the given Object Manager (something like an orm, odm) and request
- It then transforms the data into standardized resource(s) given the provided Object Reader (there are many ways to configure resources, such as doctrine annotations, configuration files, ...)
- It sends the found resources to fractal with the appropriate Transformer for serialization on the given output format.
Installation
Usage
The library's conventions are based on the jsonapi ones.
Query Paramters
The RestQueryParser will expect those query parameters:
-
Collection
sort
name
to sort by ascending name-name
to sort by descending name- Example:
?sort=-date
filter
to filter resources by values.- multiple values for filters should be provided coma-separated.
- Example:
?filter[name]=dupont,dupond&filter[surname]=thomas
filteroperator
- to change the default filter opetator from
=
to something else. - available operators:
<
,>
,<=
,>=
,!=
,in
. - Example:
?filter[age]=18&filteroperator[age]=>=
- to change the default filter opetator from
include
to include relationships data.- Example:
/books?include=author,editor
- Example:
limit
: how many results you want to see by page.page
: the page number. Starts at 1.
- Single resource
include
to include relationships data. Example:/books/1?include=author,editor
Examples
Plain ol' PHP
Symfony
See the documentation on Wizards Technologies' REST API Bundle
Laravel
We are actively looking for laravel developers to support it !
Future plans
- Add more tests
- Add the sparse fieldset feature
- Add advanced filter operators such as like or between
- Optimize how the data are fetched from the source.
- Think about serialization groups.
All versions of rest-api with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.3
psr/http-message Version ^1.0
league/fractal Version ^0.19.2
symfony/options-resolver Version ^4.1|^5.0
psr/http-message Version ^1.0
league/fractal Version ^0.19.2
symfony/options-resolver Version ^4.1|^5.0
The package wizards/rest-api contains the following files
Loading the files please wait ....