PHPackages                             jmd/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. [HTTP &amp; Networking](/categories/http)
4. /
5. jmd/rest-bundle

AbandonedArchivedSymfony-bundle[HTTP &amp; Networking](/categories/http)

jmd/rest-bundle
===============

This bundle allows you to fast generate REST api for your entities

1.0(10y ago)292MITPHPPHP &gt;=5.4

Since Feb 9Pushed 10y agoCompare

[ Source](https://github.com/mops1k/JMDRestBundle)[ Packagist](https://packagist.org/packages/jmd/rest-bundle)[ RSS](/packages/jmd-rest-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

JMDRestBundle
=============

[](#jmdrestbundle)

This bundle provide fast and simple way to generate REST api for your project entities without editing configs and creating any controllers.

### Feautures:

[](#feautures)

- CRUD web api
- Independent from other bundles and do not required bundles like FOSRestBundle or JMSSerializerBundle, etc..
- Built-in pagination and ordering

Installation
============

[](#installation)

- Download via composer

```
$ composer require jmd/rest-bundle
```

- Add into `app/AppKernel.php`:

```
public function registerBundles()
    {
        $bundles = array(
			...
            new JMD\RestBundle\JMDRestBundle(),
			...
        );
	    ...

        return $bundles;
    }
```

- Add into `app/config/routing.yml`:

```
jmd_rest:
    resource: "@JMDRestBundle/Controller/RestController.php"
    type:     annotation
    prefix:   /api
```

Usage
=====

[](#usage)

Update, delete and add methods you can use as is after installation.

### Api routes:

[](#api-routes)

#### Route parameters:

[](#route-parameters)

1. `bundleName` - name of entity bundle
2. `entityName` - name of entity
3. `id` - entity item id

namemethodpathcommentrest\_get\_entity\_listGET/api/{bundleName}/{entityName}Show list entity itemsrest\_get\_entity\_itemGET/api/{bundleName}/{entityName}/{id}Show entity item by idrest\_update\_entity\_itemPUT/api/{bundleName}/{entityName}/{id}Update entity item by idrest\_x\_update\_entity\_itemPUT/api/{bundleName}/{entityName}/{id}/xSpecial update action for x-editable jQuery pluginrest\_delete\_entity\_itemDELETE/api/{bundleName}/{entityName}/{id}Delete entity item idrest\_entity\_add\_itemPOST/api/{bundleName}/{entityName}Add new entity item### How to add or update item:

[](#how-to-add-or-update-item)

Request headers must have `Content-Type` equals `application/json`. For update any field in entity we must construct there json structure:

```
{
	"fieldName": "value",
	"fieldName2": "value"
}
```

Updating and posting supports relations. To save relations we have to set json like:

```
{
	"relationFieldToMany": [id1,id2],
	"relationFieldToOne": id3
}
```

### How to show item or items:

[](#how-to-show-item-or-items)

For showing item in entity repository we must implement `\JMD\RestBundle\Entity\RestEntityInterface` and make methods:

- `findAllArray(array $order = [])` - must return query builder. Example:

```
public function findAllArray(array $order = [])
{
		$qb = $this->createQueryBuilder('c');

		$qb->select('partial c.{id,name}');

		return $qb;
}
```

- `findOneArray($id)` - must return array or null result. Example:

```
public function findOneArray($id)
{
		$qb = $this->createQueryBuilder('c');

		$qb
				->select('partial c.{id,name}')
				->where('c.id = :id')
				->setParameter('id', $id)
		;

		return $qb->getQuery()->getOneOrNullResult(AbstractQuery::HYDRATE_ARRAY);
}
```

After you make implementation, you can send GET request and will get result like this:

```
# url: http://localhost/api/BundleName/Client
{
	"status": 200,
	"data": [
		{
			"id": 1,
			"name": "Test client"
		},
		{
			"id": 2,
			"name": "Test client 2"
		}
	]
}

# url: http://localhost/api/BundleName/Client/1
{
	"status": 200,
	"data":  {
		"id": 1,
		"name": "Test client"
	}
}
```

**That's all!**

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3793d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a66a29a89f67d6dab6dae770679e648fad33cb6f3bac253004ebe0a3fd8faf36?d=identicon)[mops1k](/maintainers/mops1k)

---

Top Contributors

[![mops1k](https://avatars.githubusercontent.com/u/3045773?v=4)](https://github.com/mops1k "mops1k (4 commits)")

---

Tags

apisymfonyrestdoctrine

### Embed Badge

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

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

###  Alternatives

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k50.1M314](/packages/api-platform-core)[api-platform/symfony

Symfony API Platform integration

354.0M110](/packages/api-platform-symfony)[srio/rest-upload-bundle

Handle multiple rest upload ways

46125.9k](/packages/srio-rest-upload-bundle)[cypresslab/patch-manager

A library to manage patch requests

16125.6k](/packages/cypresslab-patch-manager)[mediamonks/rest-api-bundle

MediaMonks Rest API Symfony Bundle

1656.2k1](/packages/mediamonks-rest-api-bundle)[adrotec/breeze.server.php

Breeze JS support for Symfony 2 or any other PHP 5.3+ application

2615.8k1](/packages/adrotec-breezeserverphp)

PHPackages © 2026

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