PHPackages                             jsonbuilder/jsonbuilder - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jsonbuilder/jsonbuilder

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

jsonbuilder/jsonbuilder
=======================

DSL for generating JSON in PHP

v1.0.1(13y ago)84.7k21MITPHP

Since May 14Pushed 11y ago1 watchersCompare

[ Source](https://github.com/raymondjavaxx/jsonbuilder)[ Packagist](https://packagist.org/packages/jsonbuilder/jsonbuilder)[ Docs](http://github.com/raymondjavaxx/jsonbuilder)[ RSS](/packages/jsonbuilder-jsonbuilder/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (3)Used By (1)

JSONBuilder
===========

[](#jsonbuilder)

DSL for generating JSON in PHP. Inspired by [JBuilder](https://github.com/rails/jbuilder).

[![Build Status](https://camo.githubusercontent.com/d3a9e748ccb7366ab8afdd4a792d356ac7acaa3fe87ca2454514f5c33214978c/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7261796d6f6e646a61766178782f6a736f6e6275696c6465722e706e67)](http://travis-ci.org/raymondjavaxx/jsonbuilder)

Usage
-----

[](#usage)

```
use \jsonbuilder\JSONBuilder;

echo JSONBuilder::object(function($json) use($message) {
	$json->id = $message->id;
	$json->author = $message->author()->fullName();

	$json->recipients($message->recipients(), function($json, $recipient) {
		$json->id = $recipient->id;
		$json->name = $recipient->fullName();
	});
});
// {"id":1,"author":"John Doe","recipients":[{"id":5,"name":"Jane Doe"},{"id":9,"name":"Adam Smith"}]}

```

License
-------

[](#license)

Licensed under the MIT License ()

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~130 days

Total

2

Last Release

5030d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fd9c86225a5caae462698823d30f942f13f2e68d5385ec92fe614b44f101a3f?d=identicon)[raymondjavaxx](/maintainers/raymondjavaxx)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/jsonbuilder-jsonbuilder/health.svg)

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

###  Alternatives

[fpn/tag-bundle

FPN Tag Bundle

75408.0k2](/packages/fpn-tag-bundle)[tarfin-labs/laravel-spatial

Laravel package to work with geospatial data types and functions.

75103.1k](/packages/tarfin-labs-laravel-spatial)[emico/m2-attributelanding

Attribute landing pages for Magento 2

17263.2k10](/packages/emico-m2-attributelanding)

PHPackages © 2026

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