PHPackages                             pittacusw/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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. pittacusw/excel

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

pittacusw/excel
===============

Collection-first Excel import and export helpers for Laravel

v2.1(2mo ago)084[4 PRs](https://github.com/PittacusW/excel/pulls)PHPPHP ^8.1CI passing

Since Apr 10Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/PittacusW/excel)[ Packagist](https://packagist.org/packages/pittacusw/excel)[ Docs](https://github.com/pittacusw/excel)[ GitHub Sponsors](https://github.com/PittacusW)[ RSS](/packages/pittacusw-excel/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (23)Versions (10)Used By (0)

PittacusW Excel
===============

[](#pittacusw-excel)

Lightweight collection-first helpers for importing and exporting spreadsheets in Laravel.

This package wraps `maatwebsite/excel` with a smaller API for the common cases:

- export collections or arrays with optional headings
- auto-derive headings from associative rows
- import spreadsheets directly into an `Illuminate\Support\Collection`
- work cleanly across Laravel 9, 10, 11, 12, and 13

Compatibility
-------------

[](#compatibility)

LaravelTestbenchPHP9.x7.x8.1+10.x8.x8.1+11.x9.x8.2+12.x10.x8.2+13.x11.x8.3+Installation
------------

[](#installation)

```
composer require pittacusw/excel
```

Usage
-----

[](#usage)

Inject the service:

```
use PittacusW\Excel\Excel;

class ExportUsersController
{
    public function __invoke(Excel $excel)
    {
        return $excel->download(
            rows: [
                ['name' => 'Ada', 'email' => 'ada@example.com'],
                ['name' => 'Grace', 'email' => 'grace@example.com'],
            ],
            fileName: 'users',
        );
    }
}
```

Use the facade explicitly:

```
use PittacusW\Excel\Facades\Excel;

$rows = Excel::import(
    file: $request->file('users.xlsx'),
    headingRow: 1,
);
```

### Export API

[](#export-api)

```
use PittacusW\Excel\Excel;

$excel->download(
    rows: [
        ['name' => 'Ada', 'email' => 'ada@example.com'],
    ],
    headings: ['Name', 'Email'],
    fileName: 'users',
);

$excel->store(
    rows: [
        ['name' => 'Ada', 'email' => 'ada@example.com'],
    ],
    filePath: 'exports/users.xlsx',
);

$contents = $excel->raw(
    rows: [
        ['name' => 'Ada', 'email' => 'ada@example.com'],
    ],
);
```

### Import API

[](#import-api)

```
use PittacusW\Excel\Excel;

$rows = $excel->import(
    file: storage_path('app/imports/users.xlsx'),
    headingRow: 1,
);
```

Imported rows are returned as an `Illuminate\Support\Collection`.

Public API
----------

[](#public-api)

```
download(iterable $rows, array $headings = [], ?string $fileName = null, ?string $writerType = null, array $headers = [])
store(iterable $rows, string $filePath, array $headings = [], ?string $disk = null, ?string $writerType = null, array|string $diskOptions = [])
raw(iterable $rows, array $headings = [], ?string $writerType = null)
import(string|\Illuminate\Http\UploadedFile $file, int $headingRow = 1, ?string $disk = null, ?string $readerType = null)
makeExport(iterable $rows, array $headings = [], ?string $fileName = null)
makeImport(int $headingRow = 1)
```

Upgrade Notes
-------------

[](#upgrade-notes)

- The package now ships a real `PittacusW\Excel\Excel` service behind the facade.
- The automatic global `Excel` alias was removed to avoid collisions with `Maatwebsite\Excel\Facades\Excel`.
- Exports now normalize associative rows and can infer headings automatically.
- Imports now keep the imported collection available after execution.

Testing
-------

[](#testing)

```
composer test
```

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance87

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% 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 ~193 days

Total

3

Last Release

62d ago

PHP version history (2 changes)v1PHP ^8.2

v2PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/97c33f4ec07e9426c6c66fe4d0b0840a31823e10992dcd1824bc91982d043ea3?d=identicon)[contal](/maintainers/contal)

---

Top Contributors

[![PittacusW](https://avatars.githubusercontent.com/u/5810290?v=4)](https://github.com/PittacusW "PittacusW (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelexportexcelimportPittacusW

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)

PHPackages © 2026

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