PHPackages                             mradang/laravel-excel - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. mradang/laravel-excel

ActiveLibrary[File &amp; Storage](/categories/file-storage)

mradang/laravel-excel
=====================

laravel-excel

v4.2.1(1w ago)0697MITPHP

Since Jan 14Pushed 1w ago1 watchersCompare

[ Source](https://github.com/mradang/laravel-excel)[ Packagist](https://packagist.org/packages/mradang/laravel-excel)[ RSS](/packages/mradang-laravel-excel/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (12)Versions (24)Used By (0)

laravel-excel
=============

[](#laravel-excel)

安装
--

[](#安装)

```
composer require mradang/laravel-excel -vvv
```

读取
--

[](#读取)

编号姓名年龄1张三212李四223王五23```
ExcelService::read(
    $pathname, // excel 文件绝对路径
    1, // 字段名行号
    [
        // 字段定义
        'id' => '编号',
        'name' => '姓名',
        'age' => '年龄',
    ],
    2, // 数据开始的行号
    function (array $cells) {
        // 行数据处理函数，每行调用一次
        /**
         * $cells = [
         *   'id' => 1,
         *   'name' => '张三',
         *   'age' => 21,
         * ];
         */
    },
);
```

写入
--

[](#写入)

$values 参数支持类型

- Illuminate\\Database\\Eloquent\\Builder
- Illuminate\\Support\\Collection
- array

当使用 Builder 类型时，会调用实例的 chunk 方法，分块读取数据

```
$pathname = ExcelService::write(
    '首行通栏标题',
    [
        // 字段定义
        'id' => '编号',
        'name' => '姓名',
        'age' => '年龄',
    ],
    ['id', 'age'], // 数字列
    [
        // 数据
        ['id' => 4, 'name' => '赵六', 'age' => 24],
        ['id' => 5, 'name' => '孙七', 'age' => 25],
        ['id' => 6, 'name' => '周八', 'age' => 26],
    ],
    function (int $index, $row) {
        // 行数据处理函数，每行调用一次，返回字段值数组
        return array_values($row);
    },
    2, // 冻结字段列
);
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~88 days

Recently: every ~128 days

Total

23

Last Release

11d ago

Major Versions

v1.2.0 → v2.0.12021-12-07

v2.2.0 → v3.0.02023-04-12

v3.2.0 → v4.0.02024-12-02

### Community

Maintainers

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

---

Top Contributors

[![mradang](https://avatars.githubusercontent.com/u/1206671?v=4)](https://github.com/mradang "mradang (29 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mradang-laravel-excel/health.svg)

```
[![Health](https://phpackages.com/badges/mradang-laravel-excel/health.svg)](https://phpackages.com/packages/mradang-laravel-excel)
```

###  Alternatives

[overtrue/laravel-filesystem-qiniu

A Qiniu storage filesystem for Laravel.

482229.7k16](/packages/overtrue-laravel-filesystem-qiniu)[rahulhaque/laravel-filepond

Use FilePond the Laravel way

261114.4k2](/packages/rahulhaque-laravel-filepond)[overtrue/laravel-filesystem-cos

A Cos storage filesystem for Laravel.

92128.4k7](/packages/overtrue-laravel-filesystem-cos)

PHPackages © 2026

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