PHPackages                             noisim/resource - 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. noisim/resource

ActiveLibrary

noisim/resource
===============

Helper package to build resources for JSON responses etc.

07PHP

Since Dec 11Pushed 8y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

**Resource** is a package which is needed to build resources for JSON responses etc. I have tested it using Phalcon PHP framework.

Install
-------

[](#install)

This package is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "noisim/resource": "dev-master"
    }
}
```

and run composer to update the dependencies `composer update`.

How to use
----------

[](#how-to-use)

Suppose in our app (which can be any framework like Laravel, Phalcon etc.) we have some models like *User*, *Post*, *Comment*. These models have their relationships between each other. So a user can have many posts, a post can have many comments, a user can have many comments, a post belongs to a user, a comment belongs to a post, a comment belongs to one user.

Regardless of used framework we can access these relations via models in this form:

```
