Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tu6ge/voyager-excel

voyager excel export --一个Voyager的Excel导出插件
https://github.com/tu6ge/voyager-excel

admin-excel-export excel-export laravel voyager

Last synced: 2 months ago
JSON representation

voyager excel export --一个Voyager的Excel导出插件

Awesome Lists containing this project

README

        

# Voyager Excel Export

[![Tests](https://github.com/tu6ge/voyager-excel/workflows/Tests/badge.svg?branch=master)](https://github.com/tu6ge/voyager-excel/actions)
[![Coverage Status](https://coveralls.io/repos/github/tu6ge/voyager-excel/badge.svg?branch=master)](https://coveralls.io/github/tu6ge/voyager-excel?branch=master)
[![Latest Stable Version](https://poser.pugx.org/tu6ge/voyager-excel/v)](https://packagist.org/packages/tu6ge/voyager-excel)
[![Packagist Downloads](https://img.shields.io/packagist/dm/tu6ge/voyager-excel)](https://packagist.org/packages/tu6ge/voyager-excel/stats)
[![styleci](https://github.styleci.io/repos/239457151/shield?branch=master)](https://github.com/tu6ge/voyager-excel)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

a plugin of [voyager](https://github.com/the-control-group/voyager) for excel export

## Required

- *voyager* this is a missing laravel admin

## Install

```bash
composer require tu6ge/voyager-excel
```

## Usage

* 1. [disable special Model](#disablespecialModel)
* 2. [Allow export all records of special Model, default export selected records](#export-all)
* 3. [Custom export excel content and format.](#custom-export)

### 1. disable special Model

You can disable export button in special Model :

```
class Example extends Model
{
public $disable_export = true;

// ...
}
```

### 2. Allow export all records of special Model, default export selected records

```
class Example extends Model
{
public $allow_export_all = true;

// ...
}
```

### 3. Custom export excel content and format.

Now, You can customize the export excel content and format, Use more features of `maatwebsite/excel`:

1. Create a custom export class , and extends `Tu6ge\VoyagerExcel\Exports\AbstractExport` :

```
dataType = $dataType;
$this->model = new $dataType->model_name(); // this is current Model instance
// $ids is user selected record ids

// write your own idea
}
}
```

`Export` class more usage, see [laravel excel documents](https://docs.laravel-excel.com/3.1/exports/collection.html)

2. Associate the export with your model:

```
Support Language

- zh_CN
- en

## Test

run `composer test` command.

## License

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftu6ge%2Fvoyager-excel.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftu6ge%2Fvoyager-excel?ref=badge_large)

## Links

- [Voyager中文文档](http://doc.laravel-voyager.cn/)

## Star

If this packages helped you, leave a star for the author.

## Contributing

[Contributing Guide](https://github.com/tu6ge/voyager-excel/blob/master/CONTRIBUTING.md)