#163

Product support

Get help in the plugin support forum.

Categories

  • Developer Tools
  • Utility

This plugin is a wrapper for Maatwebsite/Laravel-Excel package. It adds convenient tools to import/export excel files. The complete documentation can be found at: http://www.maatwebsite.nl/laravel-excel/docs

You may like my other plugins

The complete documentation can be found at: http://www.maatwebsite.nl/laravel-excel/docs

Usage

use Vdomah\Excel\Classes\Excel;

Excel::excel()->load(base_path() . '/storage/app/media/file.xlsx', function($reader) {

    dd($reader);

});

Importing a file

To start importing a file, you can use ->load($filename). The callback is optional.

Excel::load('file.xls', function($reader) {

// Getting all results
$results = $reader->get();

// ->all() is a wrapper for ->get() and will work the same
$results = $reader->all();

});

Collections

Sheets, rows and cells are collections, this means after doing a ->get() you can use all default collection methods.

// E.g. group the results
$reader->get()->groupBy('firstname');

Getting the first sheet or row

To get the first sheet or row, you can utilise ->first().

$reader->first();
  • Found the plugin useful on 11 Sep, 2017

    Thanks for this plugin!!

    It took a short while figuring it out, a very simple example for a export using a model. It may some others some time?

    use Vdomah\Excel\Classes\Excel;

    Excel::excel()->create('File name', function($excel) {

    $excel->sheet('Sheet', function($sheet) {
        $model = Yourmodelname::get();
        $sheet->fromModel($model);
    });

    })->download('xls');

  • Found the plugin useful on 26 Jun, 2017

    https://user-images.githubusercontent.com/26702880/27474018-323efc44-582b-11e7-9980-f1b418d910c8.PNG

    But after Excel::load() code column become date format [code] => Carbon\Carbon Object ( [date] => 2017-06-23 00:00:00.000000 [timezone_type] => 3 [timezone] => UTC

  • author

    Replied on 26 Jun, 2017

    plugin is just a wrapper for 3rd party library, you need to check the logic there

  • Found the plugin useful on 18 Jun, 2017

    Works great, thanks.

1.0.2

Class to get excel object easily.

May 08, 2017

1.0.1

Initialize plugin.

Dec 02, 2016