Download the PHP package freefri/cake-rest-api without Composer
On this page you can find all versions of the php package freefri/cake-rest-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download freefri/cake-rest-api
More information about freefri/cake-rest-api
Files in freefri/cake-rest-api
Package cake-rest-api
Short Description CakePHP Rest API
License MIT
Homepage https://github.com/freefri/cake-rest-api
Informations about the package cake-rest-api
RestApi package for CakePHP
Rest API for CakePHP 4.x
Configuration
-
Some configuration can be done using env variables (search for
env(
in the project to find usages). -
Some configuration when working with plugins can be done from the main configuration (
config/app.php
file).- Using the key
Swagger
is optional, but can be helpful to customize some directories (search forread('Swagger
for details) - As sibling from the main
App
configuration use the namespace of the plugin followed by the wordPlugin
.
- Using the key
For example, if your plugin namespace is called Example, create the following config file:
The following configuration can be used:
tablePrefix
: (optional) in case you want to add a prefix for you database tables, e.g.myplugin_users
. Can be empty string.routePath
: Definition for the beginning of the path for all routes in the plugin
Swagger
In order to make swagger UI with openapi description available, a new controller SwaggerJsonController
must be
created, with the corresponding route definition. The method getContent
can be overwritten in this controller
in order to add customization for the main spec info (title, description, version, etc.). Swagger generation can be
configured as described in the Configuration section above.
In any controller test the function $this->skipNextRequestInSwagger()
can be used to do not add the next request.
License
The source code for the site is licensed under the MIT license, which you can find in the LICENSE file.
All versions of cake-rest-api with dependencies
php Version >=7.4 || >=8.0
ext-mbstring Version *
ext-json Version *
cakephp/cakephp Version ^4.4
cakephp/migrations Version ^3.2
eduplex-api/cake-api-swagger Version ^0.1.4
bshaffer/oauth2-server-php Version ~1.14
composer/composer Version ^2.0