PHPackages                             chrl/restgeneratorbundle - 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. chrl/restgeneratorbundle

ActiveSymfony-bundle[API Development](/categories/api)

chrl/restgeneratorbundle
========================

REST API Generator for Symfony 3

0.5.0(8y ago)0212MITPHPPHP &gt;=5.3.0

Since Jul 9Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (8)Used By (0)

Voryx REST Generator Bundle
===========================

[](#voryx-rest-generator-bundle)

[![SensioLabsInsight](https://camo.githubusercontent.com/65d545beb32154bf1af0221222b6165285e4611e0bef653c8c40c0d4a2e781d2/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61633138343264392d346533362d343563632d386462312d6239376532653632353430652f6269672e706e67)](https://insight.sensiolabs.com/projects/ac1842d9-4e36-45cc-8db1-b97e2e62540e)

About
-----

[](#about)

A CRUD like REST Generator

Features
--------

[](#features)

- Generators RESTful action from entity
- Simplifies setting up a RESTful Controller

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

[](#installation)

Require the "voryx/restgeneratorbundle" package in your composer.json and update your dependencies.

```
$ php composer.phar require voryx/restgeneratorbundle dev-master
```

Add the VoryxRestGeneratorBundle to your application's kernel along with other dependencies:

```
public function registerBundles()
{
    $bundles = array(
        //...
          new Voryx\RESTGeneratorBundle\VoryxRESTGeneratorBundle(),
          new FOS\RestBundle\FOSRestBundle(),
          new JMS\SerializerBundle\JMSSerializerBundle($this),
          new Nelmio\CorsBundle\NelmioCorsBundle(),
        //...
    );
    //...
}
```

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

[](#configuration)

This bundle depends on a number of other Symfony bundles, so they need to be configured in order for the generator to work properly

```
framework:
    csrf_protection: false #only use for public API

fos_rest:
    routing_loader:
        default_format: json
    param_fetcher_listener: true
    body_listener: true
    #disable_csrf_role: ROLE_USER
    body_converter:
        enabled: true
    view:
        view_response_listener: force

nelmio_cors:
    defaults:
        allow_credentials: false
        allow_origin: []
        allow_headers: []
        allow_methods: []
        expose_headers: []
        max_age: 0
    paths:
        '^/api/':
            allow_origin: ['*']
            allow_headers: ['*']
            allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
            max_age: 3600

sensio_framework_extra:
    request: { converters: true }
    view:    { annotations: false }
    router:  { annotations: true }
```

Generating the Controller
-------------------------

[](#generating-the-controller)

Generate the REST controller

```
$ php app/console voryx:generate:rest
```

This will guide you through the generator which will generate a RESTful controller for an entity.

Example
-------

[](#example)

Create a new entity called 'Post':

```
$ php app/console doctrine:generate:entity --entity=AppBundle:Post --format=annotation --fields="name:string(255) description:string(255)" --no-interaction
```

Update the database schema:

```
$ php app/console doctrine:schema:update --force
```

Generate the API controller:

```
$ php app/console voryx:generate:rest --entity="AppBundle:Post"
```

### Using the API

[](#using-the-api)

If you selected the default options you'll be able to start using the API like this:

Creating a new post (`POST`)

```
$ curl -i -H "Content-Type: application/json" -X POST -d '{"name" : "Test Post", "description" : "This is a test post"}' http://localhost/app_dev.php/api/posts
```

Updating (`PUT`)

```
$ curl -i -H "Content-Type: application/json" -X PUT -d '{"name" : "Test Post 1", "description" : "This is an updated test post"}' http://localhost/app_dev.php/api/posts/1
```

Get all posts (`GET`)

```
$ curl http://localhost/app_dev.php/api/posts
```

Get one post (`GET`)

```
$ curl http://localhost/app_dev.php/api/posts/1
```

Delete (`DELETE`)

```
$ curl -X DELETE  http://localhost/app_dev.php/api/posts/1
```

Related Entities
----------------

[](#related-entities)

If you want the form to be able to convert related entities into the correct entity id on POST, PUT or PATCH, use the voryx\_entity form type

```
#Form/PostType()

    ->add(
        'user', 'voryx_entity', array(
            'class' => 'Acme\Bundle\Entity\User'
        )
    )
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~229 days

Recently: every ~285 days

Total

6

Last Release

3181d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4db2071f6d09726e5e00cf57930cb8a141d76b5a254150726835f119882bc896?d=identicon)[chrl](/maintainers/chrl)

---

Top Contributors

[![davidwdan](https://avatars.githubusercontent.com/u/4969183?v=4)](https://github.com/davidwdan "davidwdan (31 commits)")[![mbonneau](https://avatars.githubusercontent.com/u/748287?v=4)](https://github.com/mbonneau "mbonneau (10 commits)")[![Tersoal](https://avatars.githubusercontent.com/u/6338830?v=4)](https://github.com/Tersoal "Tersoal (8 commits)")[![Ninir](https://avatars.githubusercontent.com/u/855022?v=4)](https://github.com/Ninir "Ninir (5 commits)")[![ONbik-srebollo](https://avatars.githubusercontent.com/u/28051272?v=4)](https://github.com/ONbik-srebollo "ONbik-srebollo (4 commits)")[![kuldipem](https://avatars.githubusercontent.com/u/2017625?v=4)](https://github.com/kuldipem "kuldipem (2 commits)")[![cezar77](https://avatars.githubusercontent.com/u/7045848?v=4)](https://github.com/cezar77 "cezar77 (2 commits)")[![aivus](https://avatars.githubusercontent.com/u/1021703?v=4)](https://github.com/aivus "aivus (1 commits)")[![vishalmelmatti](https://avatars.githubusercontent.com/u/1233269?v=4)](https://github.com/vishalmelmatti "vishalmelmatti (1 commits)")[![chrl](https://avatars.githubusercontent.com/u/735937?v=4)](https://github.com/chrl "chrl (1 commits)")[![ilario-pierbattista](https://avatars.githubusercontent.com/u/987038?v=4)](https://github.com/ilario-pierbattista "ilario-pierbattista (1 commits)")[![maco222](https://avatars.githubusercontent.com/u/14107069?v=4)](https://github.com/maco222 "maco222 (1 commits)")[![maxpowel](https://avatars.githubusercontent.com/u/529550?v=4)](https://github.com/maxpowel "maxpowel (1 commits)")[![mhor](https://avatars.githubusercontent.com/u/4103719?v=4)](https://github.com/mhor "mhor (1 commits)")[![Moulino](https://avatars.githubusercontent.com/u/9279455?v=4)](https://github.com/Moulino "Moulino (1 commits)")

### Embed Badge

![Health badge](/badges/chrl-restgeneratorbundle/health.svg)

```
[![Health](https://phpackages.com/badges/chrl-restgeneratorbundle/health.svg)](https://phpackages.com/packages/chrl-restgeneratorbundle)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[voryx/restgeneratorbundle

REST API Generator for Symfony 2

178141.7k1](/packages/voryx-restgeneratorbundle)

PHPackages © 2026

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