A composer package designed to help you create a JSON:API in Phalcon
What happens when a PHP developer wants to create an API to drive their client-side SPA? Well you start with Phalcon (A modern super fast framework) loosely follow the JSON:API and package it up for Composer. The result is the phalcon-json-api package (herafter referred to as the API) so enjoy.
- Phalcon 3.x
- SQL persistance layer (ie. MYSQL, MariaDB) Make sure the database is supported by Phalcon's Database Abstraction Layer.
- PHP Version 7+
Read up on the latest plans for the API here.
Phalcon is the underlying framework this project depends on. Any user of the API package will need to have a working installation of Phalcon already installed on their system. The API makes extensive use of Phalcon sub systems including the ORM, Router and Service Locator.
The Phalcon JSON API package attempts to follow the JSON API as closely as possible. There are several enhancements this project incorporates beyond the JSON API specification.
New folks are encouraged to download and install the sister project that acts as a simple example application to demonstrate how one could use the API. This simple application include all the building blocks that make up the api including use of traditional Phalcon objects like Controllers and Models along with objects designed for use in the API such as Entities, Route and SearchHelpers.
Aside from meeting the system requirements, you should include this project in your composer file. Here is an example composer file that includes a few extra libraries needed for testing and timing api responses.
{
"require": {
"jsanc623/phpbenchtime": "dev-master",
"gte451f/phalcon-json-api-package": "dev-master"
},
"require-dev": {
"codeception/codeception": "*",
"flow/jsonpath": "dev-master"
}
}
Lots more help is available here.