Skip to content

testhashaccount/laravel-export-excel-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Export To Excel CSV

This package quickly export data to Excel or CSV.

Installation

You can install the package via composer:

composer require hashcrypt/export

Usage

To export data from controller you need to use class,

use Hashcrypt\Export\Export;

To export as Excel,

$data = Model::all()->toarray();
return Export::export($data, 'filename.xlsx');

To export as CSV,

$data = Model::all()->toarray();
return Export::export($data, 'filename.csv');