apalette / laravel-csv by apalette

To export data to CSV with Laravel 5.2
50
1
1
Package Data
Maintainer Username: apalette
Maintainer Contact: aurelie.palette@gmail.com (Aurélie Palette)
Package Create Date: 2016-08-24
Package Last Update: 2016-09-12
Language: PHP
License: MIT
Last Refreshed: 2024-11-19 03:06:16
Package Statistics
Total Downloads: 50
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Laravel Csv

Description

This package will help you to export data to CSV with Laravel 5.2

Installation

Add Csv Package to your composer.json file to require Bootstrap :

    require : {
        "laravel/framework": "5.2.*",
        "codeuz/csv": "dev-master"
    }

Update Composer :

    composer update

The next required step is to add the service provider to config/app.php :

    Codeuz\Csv\CsvServiceProvider::class

Use

The last required step is to export data to CSV in your Controller :

    $csv->setHeaders(['firstname' => 'User Firstname'])->setData([['firstname' => 'John', 'lastname' => 'Martin'], ['firstname' => 'Tom', 'age' => '33']])->setFilename('users')->export();

Congratulations, you have successfully installed Csv Package !