2017 © Pedro Peláez
 

library laravel-formatter

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

image

soapbox/laravel-formatter

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

  • Wednesday, June 27, 2018
  • by grahammccarthy
  • Repository
  • 25 Watchers
  • 210 Stars
  • 279,536 Installations
  • PHP
  • 18 Dependents
  • 0 Suggesters
  • 73 Forks
  • 8 Open issues
  • 10 Versions
  • 10 % Grown

The README.md

Changelog

  • Update support for Laravel 6 & phpunit 8
  • Update composer.json
  • Upgrade to PSR-4
  • add parameter newline, delimiter, enclosure, and escape to export csv
  • When converting a XML to an array, convert @attributes to attribute
  • add parameter encoding and formated to export xml
  • JSON parse fix (Instead of only converting the first level to array, use the associative array parameter with true, so all levels will be decoded to array structure)
  • Add support for laravel 5
  • add package discovery for laravel 5
  • add support delimiter to a csv

Formatter Bundle

Build Status, (*1)

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

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., (*3)

Installation

Through command line:, (*4)

composer require soapbox/laravel-formatter

Through composer.json:, (*5)

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

Parsers

All of the following are supported formats that the formatter can read from. * Array * CSV * JSON * XML * YAML, (*6)

Formats

All of the following are formats that are supported for output. * Array * CSV * JSON * XML * YAML, (*7)

General Usage

Including The Formatter, (*8)

use SoapBox\Formatter\Formatter;

Supported Types, (*9)

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

Making Your First Formatter(s), (*10)

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

Outputting From Your Formatter, (*11)

$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, (*12)

Serialized Array, (*13)

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

PHP Export, (*14)

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

The Versions

27/06 2018

dev-master

9999999-dev http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert

27/06 2018

3.1.1

3.1.1.0 http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert

23/02 2018

dev-feature/support-laravel-56

dev-feature/support-laravel-56 http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert

23/02 2018

dev-bugfix/remove-use-statements

dev-bugfix/remove-use-statements http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert

23/02 2018

dev-bugfix/php-72

dev-bugfix/php-72 http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert

16/02 2018

3.0

3.0.0.0 http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert

10/04 2015

dev-feature/add-php-7-and-hhvm-support

dev-feature/add-php-7-and-hhvm-support http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

laravel csv xml formatter yaml data convert

20/10 2014

2.0

2.0.0.0 http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

laravel csv xml formatter yaml data convert

19/08 2014

1.4

1.4.0.0 http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert

26/03 2014

1.1

1.1.0.0 http://github.com/SoapBox/laravel-formatter

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel csv xml formatter yaml data convert