PHPackages                             lezhnev74/eximport - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. lezhnev74/eximport

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

lezhnev74/eximport
==================

Library to easily validate and import Excel data

1.0(10y ago)014MITPHP

Since Jun 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/lezhnev74/Eximporter)[ Packagist](https://packagist.org/packages/lezhnev74/eximport)[ RSS](/packages/lezhnev74-eximport/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/05df0556fc9c30ca3698bc0fdf7820a8b2d08aab3bd3261f3e529502e7c6b7ae/68747470733a2f2f7472617669732d63692e6f72672f6c657a686e657637342f4578696d706f727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lezhnev74/Eximporter)[![Latest Stable Version](https://camo.githubusercontent.com/9f5818840140481c8f7fab4a1a6efdc1f22c3eb7ba93e396896969b625ceb6bf/68747470733a2f2f706f7365722e707567782e6f72672f6c657a686e657637342f6578696d706f72742f762f737461626c65)](https://packagist.org/packages/lezhnev74/eximport)[![License](https://camo.githubusercontent.com/dd03259cb6572621e77cf56dd406f979237002f163e5846fd212c175c6cc655b/68747470733a2f2f706f7365722e707567782e6f72672f6c657a686e657637342f6578696d706f72742f6c6963656e7365)](https://packagist.org/packages/lezhnev74/eximport)[![Total Downloads](https://camo.githubusercontent.com/a814c499a4b5cda4ebab1fbea1a498792dc1af76f20ee42793e97737010a5eff/68747470733a2f2f706f7365722e707567782e6f72672f6c657a686e657637342f6578696d706f72742f646f776e6c6f616473)](https://packagist.org/packages/lezhnev74/eximport)[![composer.lock](https://camo.githubusercontent.com/8c33a781b7e7a4a54c908ab4feca4400c826310b0edde57955727c90e57181de/68747470733a2f2f706f7365722e707567782e6f72672f6c657a686e657637342f6578696d706f72742f636f6d706f7365726c6f636b)](https://packagist.org/packages/lezhnev74/eximport)

Eximporter
==========

[](#eximporter)

Object oriented Excel importer with input validation It lets you to import any excel file, validate each cell and do your business logic with good and failed ones.

P.s. It will automatically skip rows with all nulls in cells.

[![Preview](./tests/resources/preview.png)](./tests/resources/preview.png)

Example
-------

[](#example)

```
use Eximporter\Eximporter;
use Eximporter\Exceptions\BadFile;

$file     = "./tests/resources/test_05.xlsx";
try {
    $importer = new Eximporter($file);

    $importer->setValidationRules([
        // you can set rules by names
        'description' => 'required',
        // you can set manual closures as rules (as an array)
        'amount'      => ['custom_rule' => function($cellvalue){ return $cell_value > 100; }]
         // you can add few rules in a row
         'title'      => [
                'required|regexp:#^[0-9]+$#',
                [
                    'custom_rule_2' => function($cell_value) { return strlen($cell_value)setHandlerForBadRow(function ($row, $bad_cells) {
        foreach ($bad_cells as $cell_title => $validation_result) {
            echo $cell_title . " failed validators: " . implode(", ", $validation_result->getFailed());
            echo "\n";

            // example output:
            // Amount failed validators: custom1
            // Description failed validators: required
            // ...
        }
    });

    // set handlers for good rows
    $importer->setHandlerForGoodRow(function ($row) {
        // business logic with $row
    });

    // ok let's go
    $importer->read();

    // you can access counters
    echo $importer->getGoodRowsCount();
    echo $importer->getBadRowsCount();

} catch (BadFile $e) {
    // unable to open this file
}

```

Usage
-----

[](#usage)

This package is intended to be used in projects with Excel import functions. It let's you easily add a validation layer and filtering options for your data. It is based on PHPOffice/PHPExcel under the hood.

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

[](#installation)

```
composer require lezhnev74/eximport

```

Requirements:

- PHP7
- PHP extension php\_zip enabled
- PHP extension php\_xml enabled
- PHP extension php\_gd2 enabled (if not compiled in)
- (read more)\[\]

Credits
-------

[](#credits)

Dmitriy Lezhnev

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

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

Unknown

Total

1

Last Release

3669d ago

### Community

Maintainers

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

---

Top Contributors

[![lezhnev74](https://avatars.githubusercontent.com/u/10206110?v=4)](https://github.com/lezhnev74 "lezhnev74 (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lezhnev74-eximport/health.svg)

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

###  Alternatives

[chaoswey/taiwan-id-validator

台灣身分證、統一編號驗證

319.9k](/packages/chaoswey-taiwan-id-validator)

PHPackages © 2026

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