2017 © Pedro Peláez
 

library lce

Export a Large CSV Files with Laravel.

image

clivern/lce

Export a Large CSV Files with Laravel.

  • Tuesday, August 8, 2017
  • by clivern
  • Repository
  • 1 Watchers
  • 10 Stars
  • 166 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

Laravel CSV Export

Export a Large Dataset in CSV Format. It is based on Symfony’s StreamedResponse and Laravel’s chunked queries., (*1)

Current version: [v1.0.4], (*2)

Installation

Via Composer, (*3)

``` bash $ composer require clivern/lce, (*4)


Then add the ServiceProvider to the providers array in `config/app.php` ```php 'providers' => [ // ... Clivern\Lce\LceServiceProvider::class, // ... ],

You can use the facade for shorter code. Add this to your aliases:, (*5)

'aliases' => [
    // ...
    'Lce' => Clivern\Lce\Facades\Lce::class,
    // ...
],

The class is bound to the ioC as lce, (*6)

$lce = App::make('lce');

Usage

For Example Let's use it to export options table., (*7)

``` php namespace App\Http\Controllers;, (*8)

use App\Http\Controllers\Controller; use App\Models\Option; # Eloquent Model use Validator; use Input; use Illuminate\Http\Request; use Illuminate\Support\Facades\View;, (*9)

class HomeController extends Controller {, (*10)

public function indexRender()
{

    return \App::make('lce')
        ->file('options')
        ->source(new Option)
        ->chunks(10)
        ->header([["Id","Option Key","Option Value"], ['', '', '']])->callback(function($option){
            return [
                $option->id,
                $option->op_key,
                $option->op_value,
            ];
        })->export();
}

}, (*11)


## Change log

Version 1.0.4:, (*12)

Composer lock file added., (*13)

Version 1.0.3:, (*14)

New method to get CSV file content. New feature to add two rows in single return., (*15)

Version 1.0.2:, (*16)

Docs Updated., (*17)

Version 1.0.1:, (*18)

Docs Updated. UTF-8 Support Added., (*19)

Version 1.0.0:, (*20)

Initial Release. ```, (*21)

Security

If you discover any security related issues, please email hello@clivern.com instead of using the issue tracker., (*22)

License

The MIT License (MIT). Please see License File for more information., (*23)

The Versions

08/08 2017

dev-master

9999999-dev

Export a Large CSV Files with Laravel.

  Sources   Download

MIT

The Requires

  • php ~5.4|~7.0

 

The Development Requires

  • php ~5.4|~7.0

laravel csv-export

08/08 2017

v1.0.4

1.0.4.0

Export a Large CSV Files with Laravel.

  Sources   Download

MIT

The Requires

  • php ~5.4|~7.0

 

The Development Requires

  • php ~5.4|~7.0

laravel csv-export

01/06 2017

v1.0.3

1.0.3.0

Export a Large CSV Files with Laravel.

  Sources   Download

MIT

The Requires

  • php ~5.4|~7.0

 

The Development Requires

  • php ~5.4|~7.0

laravel csv-export

05/11 2016

v1.0.2

1.0.2.0

Export a Large CSV Files with Laravel.

  Sources   Download

MIT

The Requires

  • php ~5.4|~7.0

 

The Development Requires

  • php ~5.4|~7.0

laravel csv-export

05/11 2016

v1.0.1

1.0.1.0

Export a Large CSV Files with Laravel.

  Sources   Download

MIT

The Requires

  • php ~5.4|~7.0

 

The Development Requires

  • php ~5.4|~7.0

laravel csv-export

05/11 2016

v1.0.0

1.0.0.0

Export a Large CSV Files with Laravel.

  Sources   Download

MIT

The Requires

  • php ~5.4|~7.0

 

The Development Requires

  • php ~5.4|~7.0

laravel csv-export