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

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

talandis/laravel-formatter
==========================

A formatting library that converts data output between XML, CSV, JSON, TXT, YAML and a few others. And supports @attributes in XML

2.4(10y ago)07.8kMITPHPPHP &gt;=5.4.0

Since Mar 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/talandis/laravel-formatter)[ Packagist](https://packagist.org/packages/talandis/laravel-formatter)[ Docs](https://github.com/talandis/laravel-formatter)[ RSS](/packages/talandis-laravel-formatter/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (8)Used By (0)

Attention!
----------

[](#attention)

This form was made to support '@attributes' together with '@value'. *Any credits should go to the original authors.***Use at your own risk!**

Formatter Bundle
================

[](#formatter-bundle)

[![Build Status](https://camo.githubusercontent.com/0cadc69168427771770566400eb3d7f6e72f5bd5839b86a0199d7d65fae584b7/68747470733a2f2f7472617669732d63692e6f72672f536f6170426f782f6c61726176656c2d666f726d61747465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/SoapBox/laravel-formatter)

A formatter package that will help you to easily convert between various formats such as XML, JSON, CSV, etc...

Goals
=====

[](#goals)

The goals of this library are to allow the transfomation of data formats from one type to another. See Parsers and Formats to see supported input / output formats.

Installation
============

[](#installation)

Through command line:

```
composer require talandis/laravel-formatter
```

Through composer.json:

```
{
  "require": {
	"talandis/laravel-formatter": "dev-master",
  }
}
```

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 DanielFurmanov\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();
```

Deprecated Functionality
------------------------

[](#deprecated-functionality)

The following have been deprecated from the library, however you can easily continue using them in your application

**Serialized Array**

```
$serialized = serialize($formatter->toArray());
```

**PHP Export**

```
$export = var_export($formatter->toArray());
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Total

6

Last Release

3686d ago

Major Versions

1.4 → 2.02014-10-20

1.0.0 → 2.32016-06-01

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

2.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1848060?v=4)[shazo](/maintainers/shazo)[@shazo](https://github.com/shazo)

---

Top Contributors

[![Jaspaul](https://avatars.githubusercontent.com/u/2836589?v=4)](https://github.com/Jaspaul "Jaspaul (36 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)")[![DanielFurmanov](https://avatars.githubusercontent.com/u/8160816?v=4)](https://github.com/DanielFurmanov "DanielFurmanov (7 commits)")[![talandis](https://avatars.githubusercontent.com/u/1598160?v=4)](https://github.com/talandis "talandis (5 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

formatterlaravelxmlconvertdatayamlcsv

### Embed Badge

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

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

###  Alternatives

[soapbox/laravel-formatter

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

2581.1M13](/packages/soapbox-laravel-formatter)[hitsend/laravel-formatter

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

2482.0k](/packages/hitsend-laravel-formatter)

PHPackages © 2026

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