MixerAPI
Streamline development of API-first applications in CakePHP
MixerAPI is a plugin of plugins, that is to say, it combines many CakePHP libraries into a coherent package to streamline API development for CakePHP applications. It eases following a REST architecture style and HATEOS. In other words, it makes developing APIs a piece of cake.
Documentation | Demo Application | Demo Source Code
This is a read-only repository. Please submit issues and PRs to mixerapi/mixerapi-dev
Installation
composer require mixerapi/mixerapi
bin/cake plugin load MixerApi
bin/cake mixerapi installSetup
To load all MixerApi plugins run bin/cake plugin load MixerApi. Alternatively, you can modify your Applications
bootstrap method yourself:
# src/Application.php
public function bootstrap(): void
{
// other logic...
$this->addPlugin('MixerApi');
}You can also load plugins individually. For instance, if your project only requires HalView and SwaggerBake your
Application->bootstrap() would resemble this:
# src/Application.php
public function bootstrap(): void
{
// other logic...
$this->addPlugin('MixerApi/HalView');
$this->addPlugin('SwaggerBake');
}If you don't need the entire suite of plugins simply composer require on an as-needed basis. It's up to you!
MixerAPI Core Plugins
MixerAPI automatically installs the following plugins for your RESTful API project:
| Plugin | Description |
|---|---|
| MixerApi/Bake | A custom bake template focused on creating RESTful CakePHP controllers in seconds |
| MixerApi/CollectionView | A Collection View for displaying configurable pagination meta-data in JSON or XML collection responses |
| MixerApi/ExceptionRender | Handles rendering entity validation errors and other exceptions for your API |
| MixerApi/HalView | A Hypertext Application Language (HAL+JSON) View for CakePHP |
| MixerApi/JsonLdView | A JSON-LD View for CakePHP |
| MixerApi/Rest | Gets your API project up and going quickly by creating routes for you |
| SwaggerBake | A delightfully tasty tool for generating Swagger documentation with OpenApi 3.0.0 schema |
Recommended Plugins
| Plugin | Description |
|---|---|
| MixerApi/Crud | A service provider for CRUD (Create/Read/Update/Delete) operations. Since this plugin uses the experimental CakePHP dependency injection it must be enabled separately. |
| Search | Search provides a simple interface to create paginate-able filters for your CakePHP application. |