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(9y ago)014MITPHP

Since Jun 13Pushed 9y ago1 watchersCompare

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

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 49% 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

3616d 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

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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