New

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

pingpong/csv-reader

Laravel 4 - Csv Reader
21,961 8
Install
composer require pingpong/csv-reader
Latest Version:1.0.0
PHP:>=5.4.0
Laravel:4
License:BSD-3-Clause
Last Updated:Aug 7, 2017
Links: GitHub  ·  Packagist
Maintainer: gravitano

Laravel 4 - CSV Reader

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Server Requirement

This package is require PHP 5.4 or higher.

Installation

Open your composer.json file, and add the new required package.

"pingpong/csv-reader": "1.0.*"

Next, open a terminal and run.

composer update

Next, Add new aliases in app/config/app.php.

'CsvReader' => 'Pingpong\CsvReader\Facades\CsvReader',

Done.

Usage

Create new instance.

$path = app_path('file.csv');

$csv = CsvReader::get($path); 

// OR

$csv = CsvReader::make($path);

Get data.

$data = $csv->getData();

Get data as array.

$data = $csv->toArray();

Get data as json.

$data = $csv->toJson();

Get data as object.

$data = $csv->toObject();

Looping.

foreach($csv as $item)
{
	var_dump($item);
}

Without Laravel

Basically all functions and APIs same as above.

$path = __DIR__ . '/path/to/csvfile.csv';

$csv = new Pingpong\CsvReader\CsvReader($path);

$data = $csv->getData();

License

This package is open-sourced software licensed under The BSD 3-Clause License

Related Packages

jdefez/laravel-csv

laravel facade to read/write csv file

1,367 0
rikless/xporter

CSV wrapper to export eloquent query result

5,162 10
istattic/sea-ess-vee

CSV Import/Export Library For Laravel

111
haruncpi/laravel-log-reader

A simple and beautiful laravel log reader

370,704 379
pingpong/generators

Laravel Generators

241,981 32

Version History

Version Released PHP Laravel License
1.0.0 >=5.4.0 4.2.* MIT