PHPackages                             eyja/rest-bundle - 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. eyja/rest-bundle

ActiveLibrary[API Development](/categories/api)

eyja/rest-bundle
================

Framework for creating REST APIs using Doctrine entities

83454[12 issues](https://github.com/Eyjafjallajokull/symfony-rest-bundle/issues)[1 PRs](https://github.com/Eyjafjallajokull/symfony-rest-bundle/pulls)PHP

Since May 9Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Eyjafjallajokull/symfony-rest-bundle)[ Packagist](https://packagist.org/packages/eyja/rest-bundle)[ RSS](/packages/eyja-rest-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Symfony REST Framework
======================

[](#symfony-rest-framework)

**Work in progress**

TLDR; RESTful API autogenerated from Symfony+Doctrine entities. Go to [docs](https://github.com/Eyjafjallajokull/symfony-rest-bundle/wiki/Generated-API) to see how it looks like.

Setup
-----

[](#setup)

To get started, install this bundle in your Symfony project, and register it in AppKernel.

```
composer require eyja/rest-bundle dev-master

# /app/AppKernel.php
new Eyja\RestBundle\EyjaRestBundle()

```

Minimal example
---------------

[](#minimal-example)

Create new bundle for Your REST API:

```
php app/console generate:bundle \
    --no-interaction --namespace=Acme/RestBundle --dir=src --format=yml

```

Change autogenerated routing definition for new bundle to look something like this:

```
# app/config/routing.yml
acme_rest:
    prefix: /api/v1/
    resource: @AcmeRestBundle/Resources/config/routing.yml
    type: rest

```

Create new doctrine entitiy:

```
php app/console generate:doctrine:entity \
    --no-interaction --entity=AcmeRestBundle:Cat \
    --fields="name:string(100)" --format=yml
php app/console doctrine:schema:update --force

```

Define serialization for this entity:

```
# src/Acme/RestBundle/Resources/serializer/Entity.Cat.yml
Acme\RestBundle\Entity\Cat:
    properties:
        id:
            type: integer
            groups: [collection, single]
        name:
            type: string
            groups: [collection, single]
```

Create simplest controller ever, no class required just service:

```
# src/Acme/RestBundle/Resources/config/services.yml
services:
  acme_rest.controller.cat:
    parent: eyja_rest.abstract_controller
    arguments: [AcmeRestBundle:Cat, cat]
    tags: [ { name: rest.controller } ]
```

Viola! You can use your new api:

```
php app/console router:debug
rest_cat_getSingle                GET    ANY    ANY  /api/v1/cat/{id}
rest_cat_getCollection            GET    ANY    ANY  /api/v1/cat
rest_cat_create                   POST   ANY    ANY  /api/v1/cat
rest_cat_update                   PUT    ANY    ANY  /api/v1/cat/{id}
rest_cat_delete                   DELETE ANY    ANY  /api/v1/cat/{id}

curl -XPOST http://localhost/app_dev.php/cat -HContent-Type:\ application/json \
    -d'{"name":"Lucifer"}'
{"id":1,"name":"Lucifer"}

curl -XGET http://localhost/app_dev.php/cat/1
{"id":1,"name":"Lucifer"}

curl -XPUT http://localhost/app_dev.php/cat/1 -HContent-Type:\ application/json \
    -d'{"name":"Lucifer -.-"}'
{"id":1,"name":"Lucifer -.-"}

curl -XGET http://localhost/app_dev.php/cat
{"results":[{"id":1,"name":"Lucifer"}],"_metadata":{"limit":20,"offset":0,"total":1}}

curl -XDELETE http://localhost/app_dev.php/cat/1
# Empty response, http status code 204
```

Larger example
--------------

[](#larger-example)

To see more complex example see [demo bundle](https://github.com/Eyjafjallajokull/symfony-rest-demo-bundle), featuring custom routes and advanced serialization.

Documentation
-------------

[](#documentation)

1. [Generated API](https://github.com/Eyjafjallajokull/symfony-rest-bundle/wiki/Generated-API).
2. [Creating rest controller](https://github.com/Eyjafjallajokull/symfony-rest-bundle/wiki/Controller).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/10b6c791b5643be845d82c59a7ed88a022de85ee3a72a9438918cdf0bdd7112f?d=identicon)[Eyjafjallajokull](/maintainers/Eyjafjallajokull)

### Embed Badge

![Health badge](/badges/eyja-rest-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/eyja-rest-bundle/health.svg)](https://phpackages.com/packages/eyja-rest-bundle)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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