Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Apr 16, 2019
1 parent 6bb5e5c commit 1f4c0de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $ composer require xiaomlove/grid-exporter -vvv
## Usage

if this extension is enabled, it will register as the default exporter (replace `Encore\Admin\Grid\Exporters\CsvExporter`)
if want to format specified column, use it manually. In your controller
if you want to format specified column, use it manually. In your controller
```php
use Chenyulingxi\LaravelAdmin\GridExporter\Exporter;
use Maatwebsite\Excel\Events\AfterSheet;
Expand Down Expand Up @@ -103,10 +103,13 @@ protected function grid()

...
```
if you want more control over the output file, you can create a class that extents from `Chenyulingxi\LaravelAdmin\GridExporter`, then inject it's instance to the exporter like this:

if you want more control over the output file, you can create a class that extents from `Chenyulingxi\LaravelAdmin\GridExporter\DataSource`, then inject it's instance to the exporter like this:

```php
$exporter->setDataSource(new TestDataSource());
```

more information reference to [Laravel Excel](https://docs.laravel-excel.com/3.1/exports/extending.html) and [PhpSpreadsheet](https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#styles)

License
Expand Down

0 comments on commit 1f4c0de

Please sign in to comment.