PHPackages                             psx/nested - 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. [Database &amp; ORM](/categories/database)
4. /
5. psx/nested

ActiveLibrary[Database &amp; ORM](/categories/database)

psx/nested
==========

Build complex nested data structures from relational databases

v0.2.0(5mo ago)013.0k↓33.3%1Apache-2.0PHPPHP &gt;=8.0CI passing

Since Apr 2Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/apioo/psx-nested)[ Packagist](https://packagist.org/packages/psx/nested)[ Docs](https://phpsx.org)[ Fund](https://www.paypal.me/fusioapi)[ GitHub Sponsors](https://github.com/chriskapp)[ RSS](/packages/psx-nested/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (5)Used By (1)

Nested
======

[](#nested)

This library helps to build complex nested JSON responses based on relational tables.

Basic usage
-----------

[](#basic-usage)

At the core this library provides a `Builder` class which allows you to define a definition structure how the result of your JSON response should look. To give you an example the following code is from our test case and should give you a first insight how you can generate a complex JSON structure s.

```
