PHPackages                             kohenkatz/laravel-restful - 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. kohenkatz/laravel-restful

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

kohenkatz/laravel-restful
=========================

Create your own REST API in Laravel. Supports JSON, JSONP, and XML output.

v1.0.2(11y ago)132MITPHP

Since Jun 29Pushed 11y ago1 watchersCompare

[ Source](https://github.com/kohenkatz/laravel-restful)[ Packagist](https://packagist.org/packages/kohenkatz/laravel-restful)[ Docs](https://github.com/kohenkatz/laravel-restful)[ RSS](/packages/kohenkatz-laravel-restful/feed)WikiDiscussions master Synced 2d ago

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

Restful Controller for Laravel
==============================

[](#restful-controller-for-laravel)

A base controller for laravel that handles formatting.

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

[](#installation)

### Composer

[](#composer)

`composer require "kohenkatz/laravel-restful"`

Once you've grabbed the code, you'll need to add the RoutingServiceProvider to the list of providers in `app/config/app.php` as follows

```
'providers' => array(
    ...
  'Kohenkatz\Restful\RoutingServiceProvider',
),

```

Usage
-----

[](#usage)

The concept uses the same principles as laravel's [resource routing](http://laravel.com/docs/controllers#resource-controllers). Your controller should extend the one in this package. Each action should return an array which will automatically be formatted.

Add the route to `app/routes.php`:

```
Route::resource('posts', 'PostsController');

```

Then add the controller as follows

```
use Kohenkatz\Restful\RestfulController;

class PostController extends RestfulController {
    public function index() {
        return array(
            array(
                'id' => 1,
                'title' => 'Released a RESTful controller',
            ),
        );
    }
}

```

Todo
----

[](#todo)

1. Split the controller down so that the encoding happens elsewhere to allow for easier extending
2. Add other encoders (php array, csv etc)
3. Add more documentation
4. Investigate if traits would be better suited for parts

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

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

Every ~1 days

Total

2

Last Release

4334d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0759b5eeafda005bac38df0e39cab4d3c6ec4cedebe9008b5df2cafccb8651ef?d=identicon)[kohenkatz](/maintainers/kohenkatz)

---

Top Contributors

[![rob-mccann](https://avatars.githubusercontent.com/u/412744?v=4)](https://github.com/rob-mccann "rob-mccann (20 commits)")[![kohenkatz](https://avatars.githubusercontent.com/u/88755?v=4)](https://github.com/kohenkatz "kohenkatz (9 commits)")

---

Tags

laravelrestroutingcontrollerrestful

### Embed Badge

![Health badge](/badges/kohenkatz-laravel-restful/health.svg)

```
[![Health](https://phpackages.com/badges/kohenkatz-laravel-restful/health.svg)](https://phpackages.com/packages/kohenkatz-laravel-restful)
```

###  Alternatives

[aplus/routing

Aplus Framework Routing Library

2491.6M3](/packages/aplus-routing)[lomkit/laravel-rest-api

A package to build quick and robust rest api for the Laravel framework.

59152.2k](/packages/lomkit-laravel-rest-api)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[guanguans/laravel-api-response

Normalize and standardize Laravel API response data structure. - 规范化和标准化 Laravel API 响应数据结构。

485.6k](/packages/guanguans-laravel-api-response)

PHPackages © 2026

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