PHPackages                             freefri/cake-rest-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. freefri/cake-rest-api

ActiveCakephp-plugin[HTTP &amp; Networking](/categories/http)

freefri/cake-rest-api
=====================

CakePHP Rest API

0.7.25(2mo ago)06.2k↓22.2%12MITPHPPHP &gt;=8.0CI passing

Since Jan 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/freefri/cake-rest-api)[ Packagist](https://packagist.org/packages/freefri/cake-rest-api)[ Docs](https://github.com/freefri/cake-rest-api)[ RSS](/packages/freefri-cake-rest-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (18)Versions (106)Used By (12)

RestApi package for CakePHP
===========================

[](#restapi-package-for-cakephp)

Rest API for CakePHP 5.x

Configuration
-------------

[](#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 for `read('Swagger` for details)
    - As sibling from the main `App` configuration use the namespace of the plugin followed by the word `Plugin`.

For example, if your plugin namespace is called Example, create the following config file:

```
return [
    'debug' => false,
    'App' => [ ... ],
    'Swagger' => [ ... ]
    'ExamplePlugin' => [
        'tablePrefix' => 'example_',
        'routePath' => '/api/v1',
    ],
];

```

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
-------

[](#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.

Logs in database
----------------

[](#logs-in-database)

Logs in database can be easily enabled.

Just add to the `Log` section in `config/app.php` the className `\RestApi\Lib\DatabaseLog::class` and add a migration with phinx:

```
$this->table('log_entries', ['collation' => 'utf8mb4_general_ci', 'id' => false])
    ->addColumn('id', 'biginteger', [
        'autoIncrement' => true,
        'default' => null,
        'limit' => null,
        'null' => false,
        'signed' => false,
    ])
    ->addPrimaryKey(['id'])
    ->addColumn('type', 'string', [
        'default' => null,
        'limit' => 50,
        'null' => true,
    ])
    ->addColumn('title', 'string', [
        'default' => null,
        'limit' => 30,
        'null' => true,
    ])
    ->addColumn('message', 'text', [
        'default' => null,
        'limit' => null,
        'null' => true,
    ])
    ->addColumn('environment', 'string', [
        'default' => null,
        'limit' => 100,
        'null' => true,
    ])
    ->addColumn('server', 'text', [
        'default' => null,
        'limit' => null,
        'null' => true,
    ])
    ->addColumn('created', 'datetime', [
        'default' => null,
        'limit' => null,
        'null' => true,
    ])
    ->addIndex(
        [
            'created',
        ]
    )
    ->create();

```

License
-------

[](#license)

The source code for the site is licensed under the **MIT license**, which you can find in the [LICENSE](../LICENSE/) file.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance88

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Recently: every ~15 days

Total

105

Last Release

80d ago

PHP version history (4 changes)0.1.0PHP &gt;=7.3

0.2.1PHP &gt;=7.4

0.5.17PHP &gt;=7.4 || &gt;=8.0

0.6.6PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2754631?v=4)[freefri](/maintainers/freefri)[@freefri](https://github.com/freefri)

---

Top Contributors

[![freefri](https://avatars.githubusercontent.com/u/2754631?v=4)](https://github.com/freefri "freefri (211 commits)")[![pnordev](https://avatars.githubusercontent.com/u/164324342?v=4)](https://github.com/pnordev "pnordev (15 commits)")

---

Tags

apirestcakephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/freefri-cake-rest-api/health.svg)

```
[![Health](https://phpackages.com/badges/freefri-cake-rest-api/health.svg)](https://phpackages.com/packages/freefri-cake-rest-api)
```

###  Alternatives

[mixerapi/mixerapi

Streamline development of API-first applications in CakePHP

4441.8k](/packages/mixerapi-mixerapi)[cakedc/cakephp-api

Api plugin for CakePHP

61100.6k](/packages/cakedc-cakephp-api)[andrej-griniuk/cakephp-fractal-transformer-view

CakePHP view builder utilizing Fractal library for entities transformation

1890.7k](/packages/andrej-griniuk-cakephp-fractal-transformer-view)[sprintcube/cakephp-rest

Rest API plugin for CakePHP 3

256.6k](/packages/sprintcube-cakephp-rest)[maurobonfietti/rest-api-slim-php

Example of REST API with Slim PHP Framework.

3061.7k](/packages/maurobonfietti-rest-api-slim-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
