PHPackages                             toproplus/laravel-admin-ext-export - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. toproplus/laravel-admin-ext-export

ActiveLibrary

toproplus/laravel-admin-ext-export
==================================

基于laravel-admin的导出工具

0.0.5(2y ago)024↓100%MITPHPPHP &gt;=7.0.0

Since Aug 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/toproplus/laravel-admin-ext-export)[ Packagist](https://packagist.org/packages/toproplus/laravel-admin-ext-export)[ Docs](https://github.com/toproplus/laravel-admin-ext-export)[ RSS](/packages/toproplus-laravel-admin-ext-export/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (6)Used By (0)

laravel-admin 导出工具
------------------

[](#laravel-admin-导出工具)

laravel-admin extension export

### 安装

[](#安装)

拉取 [package](https://packagist.org/packages/toproplus/laravel-admin-ext-export)

```
composer require toproplus/laravel-admin-ext-export
```

### 使用

[](#使用)

- 直接导出

```
use Toproplus\Export\Widgets\CsvExport;
...
$grid->exporter(new CsvExport());
```

- 自定义导出文件名

```
$csvExport = new CsvExport();
$csvExport->setName('会员列表');
$grid->exporter($csvExport);
```

- 修改字段输出值

```
// 修改add_time时间戳为日期格式
$csvExport->setColumn('add_time', function ($value) {
    return $value > 0 ? date('Y-m-d H:i:s', $value) : '';
});
// 如果要同时获取其他字段的值
$csvExport->setColumn('name', function ($name, $data) {
    return $name . '-' . $data['mobile'];
});
```

- 追加导出的字段

```
// 追加表格中未显示，但列表数据中已存在的字段值
$csvExport->addColumn('goods_spec', '商品规格');
// 追加字段并修改输出的值
$csvExport->addColumn('goods_spec', '商品规格', function($data) {
    return '规格：' . $data['goods_spec'];
});
// 追加到指定字段的后面
// 追加 goods_spec 到 goods_name 的后面
$csvExport->addColumn('goods_spec', '商品规格', 'goods_name');
// 追加到指定字段后，并修改输出值
$csvExport->addColumn('goods_spec', '商品规格', 'goods_name', function($data) {
    return '规格：' . $data['goods_spec'];
});
// 追加二维（或多维）数组下的字段，键用“.”相连
$csvExport->addColumn('posts.comments.user_id', '文章评论人ID');
// 追加不存在的字段并设置输出值
// 追加不存在的字段，一定要设置输出值
$csvExport->addColumn('hahaha', '哈哈哈', function($data) {
    return '哈哈哈' . $data['name'];
});
```

- 列表数据重新整理

```
$csvExport->setList(function ($columns, $list) {
    foreach ($list as $index => $data) {
        foreach ($columns as $column => $name) {
            switch ($column) {
                case 'status':
                    $status_list = [0 => '禁用', 1 => '启用'];
                    $data[$column] = $status_list[$data[$column]] ?? '未知';
                    break;
                case in_array($column, ['add_time', 'create_time', 'last_time']):
                    $data[$column] = $data[$column] > 0 ? date('Y-m-d H:i:s', $data[$column]) : '';
                    break;
            }

        }
        $list[$index] = $data;
    }
    return $list;
});
```

- 打印调试

```
$csvExport->dd();
```

###  Health Score

19

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~65 days

Total

5

Last Release

1064d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a843a2cac11aa828c954d0efb58c8a1a2e45c0ec8a451e4c3b9b45941e0d26b9?d=identicon)[toproplus](/maintainers/toproplus)

---

Top Contributors

[![toproplus](https://avatars.githubusercontent.com/u/40302335?v=4)](https://github.com/toproplus "toproplus (6 commits)")

---

Tags

exportextensionlaravel-adminlaravel-admin-ext

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/toproplus-laravel-admin-ext-export/health.svg)

```
[![Health](https://phpackages.com/badges/toproplus-laravel-admin-ext-export/health.svg)](https://phpackages.com/packages/toproplus-laravel-admin-ext-export)
```

###  Alternatives

[laravel-admin-ext/grid-lightbox

Turn your grid into a lightbox &amp; gallery

58179.3k2](/packages/laravel-admin-ext-grid-lightbox)[laravel-admin-ext/wang-editor

wangEditor extension for laravel-admin

6283.0k](/packages/laravel-admin-ext-wang-editor)[xiaomlove/grid-exporter

export grid data for laravel-admin

116.3k](/packages/xiaomlove-grid-exporter)[laravel-admin-ext/sparkline

Integrates jQuery sparkline into laravel-admin

161.1k](/packages/laravel-admin-ext-sparkline)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
