PHPackages                             metabytes-sro/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. metabytes-sro/laravel-formatter

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

metabytes-sro/laravel-formatter
===============================

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

3.6.2(1y ago)015.4k↓39.6%1MITPHPPHP ^8.2

Since Mar 26Pushed 1y agoCompare

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

READMEChangelog (4)Dependencies (4)Versions (13)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.

Works with Laravel 6.x, 7.x, 8.x

Based on [Soapbox/laravel-formatter](https://github.com/Soapbox/laravel-formatter), [ejetar/laravel-formatter](https://github.com/ejetar/laravel-formatter)

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

[](#installation)

Through command line:

```
composer require metabytes-sro/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 MetabytesSRO\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

44

—

FairBetter than 92% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~347 days

Recently: every ~406 days

Total

12

Last Release

612d ago

Major Versions

1.4 → 2.02014-10-20

2.0 → 3.02018-02-16

PHP version history (6 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

3.4.0PHP ^8.1

3.6.2PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/9336c1b9ee8b007c3eac0aff0f53c48524d011393b37f15b81f9bb37cc409c3c?d=identicon)[Metabytes s.r.o.](/maintainers/Metabytes%20s.r.o.)

---

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)")[![Quosimadu](https://avatars.githubusercontent.com/u/10835161?v=4)](https://github.com/Quosimadu "Quosimadu (9 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

responsephpjsonformatterlaravelxmlconvertdatayamlcsvformatoutput

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/metabytes-sro-laravel-formatter/health.svg)](https://phpackages.com/packages/metabytes-sro-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.3M712](/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)
