PHPackages                             fersot/excel-to - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fersot/excel-to

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fersot/excel-to
===============

Laravel package that converts Excel/CSV files to JSON, Collection, or Array — with fluent API, sheet selection, column filtering, and export support.

v2.0.0(1mo ago)1261MITPHPPHP ^8.1

Since Oct 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fersot/excel-to)[ Packagist](https://packagist.org/packages/fersot/excel-to)[ Docs](https://github.com/fersot/excel-to)[ RSS](/packages/fersot-excel-to/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (1)

Laravel Excel to JSON / Collection / Array
==========================================

[](#laravel-excel-to-json--collection--array)

This Laravel package provides utilities for converting Excel files to JSON format, Laravel Collections, or PHP Arrays. It also supports reading data from multiple sheets within an Excel file.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require fersot/excel-to
```

Usage
-----

[](#usage)

### JSON Conversion

[](#json-conversion)

To convert an Excel file to JSON format, use the `json` method of the `ExcelTo` class:

```
use Fersot\ExcelTo\ExcelTo;

$jsonData = ExcelTo::json('path/to/your/excel_file.xlsx');
```

This will return a JSON-encoded string representing the Excel data. If the Excel file contains multiple sheets, the data will be organized by sheet names.

### Collection Conversion

[](#collection-conversion)

To convert an Excel file to a Laravel Collection, use the `collection` method of the `ExcelTo` class:

```
use Fersot\ExcelTo\ExcelTo;

$collection = ExcelTo::collection('path/to/your/excel_file.xlsx');
```

This will return a Laravel Collection containing the Excel data. When multiple sheets are present, each sheet's data will be a collection keyed by the sheet name.

### Array Conversion

[](#array-conversion)

To convert an Excel file to a PHP Array, use the `array` method of the `ExcelTo` class:

```
use Fersot\ExcelTo\ExcelTo;

$arrayData = ExcelTo::array('path/to/your/excel_file.xlsx');
```

This will return a PHP array containing the Excel data. Similar to JSON and Collection, multiple sheets will be keyed by their names.

Example
-------

[](#example)

```
use Fersot\ExcelTo\ExcelTo;

// Convert Excel to JSON
$jsonData = ExcelTo::json('path/to/your/excel_file.xlsx');

// Convert Excel to Collection
$collection = ExcelTo::collection('path/to/your/excel_file.xlsx');

// Convert Excel to Array
$arrayData = ExcelTo::array('path/to/your/excel_file.xlsx');
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Laravel &gt;= 8.x
- PhpSpreadsheet &gt;= 1.20

Author
------

[](#author)

- **Hember Colmenares** -  ([Github](https://github.com/fersot))

Contributing
------------

[](#contributing)

Contributions are welcome! Feel free to submit pull requests or open an issue if you find any bugs or have any suggestions for improvements.

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

### Key Updates:

[](#key-updates)

1. **Support for Multiple Sheets:**

    - Described how the package handles multiple sheets, with data organized by sheet names.
2. **Array Conversion:**

    - Added a new section for array conversion, including an example of how to use the new `array` method.
3. **Clarified Output Format:**

    - Explained the structure of the data returned by each method, emphasizing the handling of single vs. multiple sheets.

Feel free to modify any section further if you have additional details or preferences for the README content.

Support Me ☕️
-------------

[](#support-me-️)

Thanks for visiting my repository! If you like my work and want to support me in building more awesome projects, you can do so through [Buy Me a Coffee](https://buymeacoffee.com/fersot).

[![Buy Me a Coffee](https://camo.githubusercontent.com/48e263a7a2c3a0618ed500a63b90f03fc7338cd104f35711fb6506f783c63007/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275792532304d6525323061253230436f666665652d4646383133463f7374796c653d666f722d7468652d6261646765266c6f676f3d6275796d6561636f66666565266c6f676f436f6c6f723d7768697465)](https://buymeacoffee.com/fersot)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance59

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

2

Last Release

53d ago

Major Versions

1.0.0 → v2.0.02026-03-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/24cfa31c919d7aa4a7f190b53789cd4d6c4d5652c64a298e463da05450b6ead9?d=identicon)[fersot](/maintainers/fersot)

---

Top Contributors

[![fersot](https://avatars.githubusercontent.com/u/11588218?v=4)](https://github.com/fersot "fersot (5 commits)")

---

Tags

jsonlaravelexportexcelxlsxcsvspreadsheetcollectionphpspreadsheet

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)

PHPackages © 2026

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