PHPackages                             chubbyphp/chubbyphp-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. chubbyphp/chubbyphp-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

chubbyphp/chubbyphp-api
=======================

A set of CRUD middleware and request handlers for building APIs with PSR-15.

1.1.1(1mo ago)0587↑22.2%MITPHPPHP ^8.3CI passing

Since Jan 18Pushed 3mo agoCompare

[ Source](https://github.com/chubbyphp/chubbyphp-api)[ Packagist](https://packagist.org/packages/chubbyphp/chubbyphp-api)[ RSS](/packages/chubbyphp-chubbyphp-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (30)Versions (4)Used By (0)

chubbyphp-api
=============

[](#chubbyphp-api)

[![CI](https://github.com/chubbyphp/chubbyphp-api/actions/workflows/ci.yml/badge.svg)](https://github.com/chubbyphp/chubbyphp-api/actions/workflows/ci.yml)[![Coverage Status](https://camo.githubusercontent.com/6abe29ca16aeda515674152b7cd1ab4ed92823666e37fbeacfbeed72de1ae60d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6368756262797068702f6368756262797068702d6170692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/chubbyphp/chubbyphp-api?branch=master)[![Mutation testing badge](https://camo.githubusercontent.com/604bf7e1bb24c49a7e8eef85a9dac898cf21b5bc5d8842997bf590778ee12738/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532466368756262797068702532466368756262797068702d6170692532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-api/master)[![Latest Stable Version](https://camo.githubusercontent.com/c5c7e640566810d58f41b7644e78460de61b9428bc4d4f336c55745663215fd0/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d6170692f76)](https://packagist.org/packages/chubbyphp/chubbyphp-api)[![Total Downloads](https://camo.githubusercontent.com/f2f6ae48cb0ebc51e93189b7f788c3c3b0343863eee3b57519472d3ef2cf6a20/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d6170692f646f776e6c6f616473)](https://packagist.org/packages/chubbyphp/chubbyphp-api)[![Monthly Downloads](https://camo.githubusercontent.com/823d862b4f0e2e5c868094a63b78cd63c36b04c4714d8bb8553c3d65e90abd3f/68747470733a2f2f706f7365722e707567782e6f72672f6368756262797068702f6368756262797068702d6170692f642f6d6f6e74686c79)](https://packagist.org/packages/chubbyphp/chubbyphp-api)

[![bugs](https://camo.githubusercontent.com/3b3ac5114d1ec9567b37196bb5fb3670656b86545959cb2a3de330a14af0942b/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d62756773)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![code_smells](https://camo.githubusercontent.com/bbdd2ce2ac47b6f0def3ada1d4e6f353f3ba2febdaaa547ae579b81623ea87e2/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d636f64655f736d656c6c73)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![coverage](https://camo.githubusercontent.com/3cf7387bec86323977f21efd1fda1b62fa4edc268b7364135e98db9d86b309ea/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![duplicated_lines_density](https://camo.githubusercontent.com/ffa8bc3067819c9bf3ecff6e3429c8fbe249127a08387c701240e8ee8c1faea9/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![ncloc](https://camo.githubusercontent.com/14750e158228041df8dca3e8b655a27fa8eb9a45da25d360049bedf21dbb277f/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d6e636c6f63)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![sqale_rating](https://camo.githubusercontent.com/f84e9f7bec3c8c85b3e4b789e551b464494aaedea4257582925224e38399bacd/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![alert_status](https://camo.githubusercontent.com/7b390b6575d7bcf2e1cf5f86c9e0afc8c7159740436fced5f2301de1d270512b/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![reliability_rating](https://camo.githubusercontent.com/1f8c2294e3937444c336db37d81434ce5073b3d08201798199e9a7abba8aa640/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![security_rating](https://camo.githubusercontent.com/85c7e11fabffe4f947263f59e3d3b734770e50addcc0590b6e4e7867c7df2e57/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![sqale_index](https://camo.githubusercontent.com/b9a0b1bf3da8d0280fa96a2e4a9210a857f2219ab2a9ff64b7d81ae244caa93e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)[![vulnerabilities](https://camo.githubusercontent.com/b394babf7c0284ae96fe09b4c8ce57731bfef0f456a11ca7bbf69bfdabfd0c9e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6368756262797068705f6368756262797068702d617069266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-api)

Description
-----------

[](#description)

A set of CRUD middleware and request handlers for building APIs with PSR-15.

Requirements
------------

[](#requirements)

- php: ^8.3
- [chubbyphp/chubbyphp-decode-encode](https://packagist.org/packages/chubbyphp/chubbyphp-decode-encode): ^1.4
- [chubbyphp/chubbyphp-http-exception](https://packagist.org/packages/chubbyphp/chubbyphp-http-exception): ^1.3.2
- [chubbyphp/chubbyphp-parsing](https://packagist.org/packages/chubbyphp/chubbyphp-parsing): ^2.2
- [psr/container](https://packagist.org/packages/psr/container): ^1.1.2|^2.0.2
- [psr/http-message](https://packagist.org/packages/psr/http-message): ^1.1|^2.0
- [psr/http-server-handler](https://packagist.org/packages/psr/http-server-handler): ^1.0.2
- [psr/http-server-middleware](https://packagist.org/packages/psr/http-server-middleware): ^1.0.2
- [ramsey/uuid](https://packagist.org/packages/ramsey/uuid): ^4.9.2

Installation
------------

[](#installation)

Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-api](https://packagist.org/packages/chubbyphp/chubbyphp-api).

```
composer require chubbyphp/chubbyphp-api "^1.0"
```

Usage
-----

[](#usage)

- [Model](#model)
- [Collection](#collection)
- [DTOs](#dtos)
    - [Model Request](#model-request)
    - [Model Response](#model-response)
    - [Collection Request](#collection-request)
    - [Collection Response](#collection-response)
- [Parsing](#parsing)
- [Repository](#repository)
- [Request Handlers](#request-handlers)

### Model

[](#model)

Implement `ModelInterface` for your domain models. Models must provide an ID, timestamps, and JSON serialization.

```
