PHPackages                             ejetar/laravel-formatter - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. ejetar/laravel-formatter

AbandonedArchivedLibrary[PDF &amp; Document Generation](/categories/documents)

ejetar/laravel-formatter
========================

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

3.2.0(6y ago)53361MITPHPPHP &gt;=7.2.5

Since Mar 26Pushed 6y agoCompare

[ Source](https://github.com/ejetar/laravel-formatter)[ Packagist](https://packagist.org/packages/ejetar/laravel-formatter)[ Docs](https://ejetar.com/projects/laravel-formatter)[ RSS](/packages/ejetar-laravel-formatter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (4)Versions (9)Used By (0)

Laravel Formatter
=================

[](#laravel-formatter)

Table of Contents
-----------------

[](#table-of-contents)

- [About](#about)
- [Installation](#installation)
- [Parsers](#parsers)
- [Formats](#formats)
- [General Usage](#general-usage)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)

About
-----

[](#about)

A package that enables you to convert your data into various formats such as JSON, XML, CSV and YAML. Based on FuelPHP's 💧 formatter class.

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

[](#installation)

Through command line:

```
composer require ejetar/laravel-formatter
```

Parsers
-------

[](#parsers)

All of the following are supported formats that the formatter can read from.

- Array
- CSV
- JSON
- XML
- YAML

Formats
-------

[](#formats)

All of the following are formats that are supported for output.

- Array
- CSV
- JSON
- XML
- YAML

General Usage
-------------

[](#general-usage)

**Including The Formatter**

```
use Ejetar\Formatter\Formatter;
```

**Supported Types**

```
Formatter::JSON; //json
Formatter::CSV;  //csv
Formatter::XML;  //xml
Formatter::ARR;  //array
Formatter::YAML; //yaml
```

**Making Your First Formatter(s)**

```
$formatter = Formatter::make($jsonString, Formatter::JSON);
$formatter = Formatter::make($yamlString, Formatter::YAML);
$formatter = Formatter::make($array, Formatter::ARR);
...
```

**Outputting From Your Formatter**

```
$csv   = $formatter->toCsv();
$json  = $formatter->toJson();
$xml   = $formatter->toXml();
$array = $formatter->toArray();
$yaml  = $formatter->toYaml();
```

Changelog
---------

[](#changelog)

Nothing for now...

Contributing
------------

[](#contributing)

Contribute to this wonderful project, it will be a pleasure to have you with us. Let's help the free software community. You are invited to incorporate new features, make corrections, report bugs, and any other form of support. Don't forget to star in this repository! 😀

License
-------

[](#license)

This library is a open-source software licensed under the MIT license.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 53.6% 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 ~314 days

Recently: every ~194 days

Total

8

Last Release

2227d ago

Major Versions

1.4 → 2.02014-10-20

2.0 → 3.02018-02-16

PHP version history (4 changes)1.1PHP &gt;=5.3.0

2.0PHP &gt;=5.4.0

3.0PHP &gt;=7.0.10

3.2.0PHP &gt;=7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/781358602863d7536e95494388bda4d9f53175fdf5029d9db7b45d4eabef10e9?d=identicon)[ejetar](/maintainers/ejetar)

![](https://www.gravatar.com/avatar/0f38f3cc45c3861823f86149c7dcad812185a96fcfc57fb6bc00de1a4fe773b3?d=identicon)[guilhermeagirardi](/maintainers/guilhermeagirardi)

---

Top Contributors

[![Jaspaul](https://avatars.githubusercontent.com/u/2836589?v=4)](https://github.com/Jaspaul "Jaspaul (45 commits)")[![grahammccarthy](https://avatars.githubusercontent.com/u/1336930?v=4)](https://github.com/grahammccarthy "grahammccarthy (19 commits)")[![dberry37388](https://avatars.githubusercontent.com/u/1000887?v=4)](https://github.com/dberry37388 "dberry37388 (9 commits)")[![ggirardi1](https://avatars.githubusercontent.com/u/2306117?v=4)](https://github.com/ggirardi1 "ggirardi1 (3 commits)")[![drolean](https://avatars.githubusercontent.com/u/810731?v=4)](https://github.com/drolean "drolean (3 commits)")[![worzy](https://avatars.githubusercontent.com/u/1092417?v=4)](https://github.com/worzy "worzy (1 commits)")[![cecilozaur](https://avatars.githubusercontent.com/u/853395?v=4)](https://github.com/cecilozaur "cecilozaur (1 commits)")[![dpwilhelmsen](https://avatars.githubusercontent.com/u/1758049?v=4)](https://github.com/dpwilhelmsen "dpwilhelmsen (1 commits)")[![garethtdavies](https://avatars.githubusercontent.com/u/135382?v=4)](https://github.com/garethtdavies "garethtdavies (1 commits)")[![AustinW](https://avatars.githubusercontent.com/u/333398?v=4)](https://github.com/AustinW "AustinW (1 commits)")

---

Tags

conversionconvertcsvdataformatformatterjsonlaraveloutputphpresponsexmlyamlresponsephpjsonformatterlaravelxmlconvertdatayamlcsvformatoutput

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ejetar-laravel-formatter/health.svg)

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

###  Alternatives

[soapbox/laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

2501.1M12](/packages/soapbox-laravel-formatter)[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M710](/packages/maatwebsite-excel)[hitsend/laravel-formatter

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others.

2502.0k](/packages/hitsend-laravel-formatter)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)

PHPackages © 2026

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