PHPackages                             donurks/phrest - 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. [API Development](/categories/api)
4. /
5. donurks/phrest

ActiveLibrary[API Development](/categories/api)

donurks/phrest
==============

A REST API lib with swagger and hateoas support.

41331PHP

Since Nov 8Pushed 8y ago4 watchersCompare

[ Source](https://github.com/DonUrks/Phrest)[ Packagist](https://packagist.org/packages/donurks/phrest)[ RSS](/packages/donurks-phrest/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/dcb23350387326d94c54025c328f1c72261b91f2b931ca9d5a09b16663648ce4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f446f6e55726b732f7068726573742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/DonUrks/phrest/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f90388e22f388e11c15745185d9ef8899066573d241a2f77ae7b36928d05dbb0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f446f6e55726b732f7068726573742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/DonUrks/phrest/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/72ffbca3cd557f800d03422dd9b91f2080d5f91858af507666a71c4179d0b448/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f446f6e55726b732f7068726573742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/DonUrks/phrest/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/92938d7f97f6625d5bb65d4bf8955fc2b8d15c88cd54fbc3c1d0ebba515b5d5c/68747470733a2f2f706f7365722e707567782e6f72672f646f6e75726b732f7068726573742f762f737461626c65)](https://packagist.org/packages/donurks/phrest)[![Total Downloads](https://camo.githubusercontent.com/fa7290351694b4d995a64ca2f9f2978d3678d69edc521b6fafc5bc779ceda116/68747470733a2f2f706f7365722e707567782e6f72672f646f6e75726b732f7068726573742f646f776e6c6f616473)](https://packagist.org/packages/donurks/phrest)[![License](https://camo.githubusercontent.com/f3ffe57bf0023111b8f090a48550ea126c4ef1af0e5d6abdd20bde8a4298d469/68747470733a2f2f706f7365722e707567782e6f72672f646f6e75726b732f7068726573742f6c6963656e7365)](https://packagist.org/packages/donurks/phrest)

phrest
======

[](#phrest)

A PHP framework for building RESTful APIs with JSON and Swagger support. Phrest will automatically scan your code for swagger or HATEOAS annotations. If desired phrest will use the scanned swagger annotations for request data validation (see [AbstractSwaggerValidatorAction](#abstractswaggervalidatoraction)).

Features
--------

[](#features)

- Swagger 2.0 definitions in annotations ([zircote/swagger-php](https://github.com/zircote/swagger-php))
- HATEOAS response definitions in annotations ([willdurand/Hateoas](https://github.com/willdurand/Hateoas))
- Request data validation against swagger data ([justinrainbow/json-schema](https://github.com/justinrainbow/json-schema))
- PSR-3 Logging ([Seldaek/monolog](https://github.com/Seldaek/monolog))
- PSR-7 HTTP Message
- PSR-11 Container
- PSR-15 Middleware (extendable)
- Error codes for API consumers
- Unified exception handling for HTTP status codes

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

[](#requirements)

- PHP 7.1
- Understanding zircote/swagger-php annotations
- Understanding willdurand/Hateoas annotations

Installation (with [Composer](https://getcomposer.org))
-------------------------------------------------------

[](#installation-with-composer)

### Command line

[](#command-line)

```
composer require donurks/phrest
```

### public/index.php

[](#publicindexphp)

```
