New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

izzy-p/laravel-formatter

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

Larablocks Analysis

izzy-p/laravel-formatter works with Laravel 4 (latest release 2.0, Oct 20, 2014), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 4, past end of life
  • No release in the last 12 months (last: Oct 20, 2014)
  • 0 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Oct 20, 2014.
  • No releases in the last 12 months.
  • First released: Mar 26, 2014.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require izzy-p/laravel-formatter
Latest Version:2.0
PHP:>=5.4.0
Laravel:4
License:MIT
Last Updated:Mar 29, 2015
Links: GitHub  ·  Packagist
Maintainer: izzyp

Formatter Bundle

Build Status

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

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

Through command line:

composer require IzzyP/laravel-formatter

Through composer.json:

{
  "require": {
    "IzzyP/laravel-formatter": "2.x"
  }
}

Parsers

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

  • Array
  • CSV
  • JSON
  • XML
  • YAML

Formats

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

  • Array
  • CSV
  • JSON
  • XML
  • YAML

General Usage

Including The Formatter

use IzzyP\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

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());

Alternatives to izzy-p/laravel-formatter

spatie/array-to-xml

Convert an array to xml

78,890,314 1,200
mtownsend/xml-to-array

Easily convert valid xml to a php array.

5,083,963 116
rodenastyle/stream-parser

PHP Multiformat Streaming Parser

214,090 440
axp-dev/file-parser

File Parser Library for PHP

20,809 5

Version History

Version Released PHP Laravel License
2.0 >=5.4.0 >=4.0 MIT
1.4 >=5.3.0 >=4.0 MIT
1.1 >=5.3.0 >=4.0,<4.2 MIT