PHPackages                             laravel-enso/dataimport - 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. laravel-enso/dataimport

Abandoned → [laravel-enso/data-import](/?search=laravel-enso%2Fdata-import)Library[File &amp; Storage](/categories/file-storage)

laravel-enso/dataimport
=======================

Excel Importer dependency for Laravel Enso

6.11.5(1mo ago)2017.1k92MITPHP

Since Apr 24Pushed 1mo ago6 watchersCompare

[ Source](https://github.com/laravel-enso/data-import)[ Packagist](https://packagist.org/packages/laravel-enso/dataimport)[ Docs](https://github.com/laravel-enso/data-import)[ RSS](/packages/laravel-enso-dataimport/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (25)Versions (478)Used By (2)

Data Import
===========

[](#data-import)

[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Stable](https://camo.githubusercontent.com/818e717e6a630ebb0411d1bfb9e0b35231a675cae7d082ed078b6f6940c57133/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f646174612d696d706f72742f76657273696f6e)](https://packagist.org/packages/laravel-enso/data-import)[![Downloads](https://camo.githubusercontent.com/40d995715b93a696528cd2eb6ed11338ec34fd47697e86ccb2beb916b0ab1df1/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f646174612d696d706f72742f646f776e6c6f616473)](https://packagist.org/packages/laravel-enso/data-import)[![PHP](https://camo.githubusercontent.com/da7cf113b588d26fe679dfefe4a15009272ed358ad4e786ad3c78b45faa61d69/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d3737376262342e737667)](composer.json)[![Issues](https://camo.githubusercontent.com/4faba0d9897e4e0a75ccf105f211038167db5d2b823100fa91dc66af386e89db/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6c61726176656c2d656e736f2f646174612d696d706f72742e737667)](https://github.com/laravel-enso/data-import/issues)[![Merge Requests](https://camo.githubusercontent.com/43010fbdf766ec19be1b8862d881999e8d3774f5626fc3f5b934d047ee5b3a8b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f6c61726176656c2d656e736f2f646174612d696d706f72742e737667)](https://github.com/laravel-enso/data-import/pulls)

Description
-----------

[](#description)

Data Import adds template-driven spreadsheet imports to Enso.

The package validates uploaded files against JSON template definitions, splits work into queued jobs, tracks import progress and status, generates rejected-row workbooks when needed, and exposes the API endpoints required by the Enso import UI.

It supports multi-sheet XLSX imports as well as CSV and TXT imports, with configurable structure validation, queue separation, and retention policies.

Seeder-style imports can also resolve the acting Enso user through the configurable `seederUserId` setting, which is useful when imports are executed outside a regular authenticated request.

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

[](#installation)

Install the package:

```
composer require laravel-enso/data-import
```

Run the package migrations:

```
php artisan migrate
```

Optional publishes:

```
php artisan vendor:publish --tag=data-import-config
php artisan vendor:publish --tag=data-import-factory
php artisan vendor:publish --tag=data-import-mail
php artisan vendor:publish --tag=data-import-examples
```

Register at least one import type in `config/enso/imports.php`:

```
'configs' => [
    'userGroups' => [
        'label' => 'User Groups',
        'template' => 'app/Imports/Templates/userGroups.json',
    ],
],
```

If you use seed-style imports that need a tracked Enso user, configure the fallback user id:

```
'seederUserId' => env('DATA_IMPORT_SEEDER_USER_ID', 1),
```

The `ExcelSeeder` service uses this value to resolve the user passed into import hooks and `track-who` aware models when there is no authenticated session.

The package schedules these maintenance commands daily:

- `enso:data-import:purge`
- `enso:data-import:cancel-stuck`

Features
--------

[](#features)

- Template-driven import definitions using JSON files.
- Queue-based splitting and processing for large imports.
- Support for `xlsx`, `csv`, and `txt` uploads.
- Strict or flexible structure validation.
- Rejected-row report generation with an extra errors column.
- Shared mail layout and preview registration through `laravel-enso/mails`, including a download link for uploaded import files.
- Downloadable import templates generated from the JSON definition.

Usage
-----

[](#usage)

Create an importer class that implements the package contract:

```
use LaravelEnso\DataImport\Contracts\Importable;
use LaravelEnso\DataImport\Models\Import;
use LaravelEnso\Helpers\Services\Obj;

class UserGroupImporter implements Importable
{
    public function run(Obj $row, Import $import)
    {
        UserGroup::create($row->all());
    }
}
```

Point a template configuration entry to a JSON template that defines sheets, columns, and the importer class. The package can then:

- serve the generated template workbook
- validate uploaded files against the template
- queue the import when the structure is valid

When the import runs through the seeder-oriented flow, the package resolves the acting user from `config('enso.imports.seederUserId')`. Set `DATA_IMPORT_SEEDER_USER_ID` to an Enso user that should own created records, approvals, and audit metadata produced by those imports.

API
---

[](#api)

### HTTP routes

[](#http-routes)

- `POST api/import/store`
- `DELETE api/import/{import}`
- `GET api/import/download/{import}`
- `GET api/import/initTable`
- `GET api/import/tableData`
- `GET api/import/exportExcel`
- `PATCH api/import/{import}/cancel`
- `PATCH api/import/{import}/restart`
- `GET api/import/options`
- `GET api/import/{type}`
- `GET api/import/{type}/template`
- `GET api/import/{rejected}/rejected`

### Artisan commands

[](#artisan-commands)

- `enso:data-import:purge`
- `enso:data-import:cancel-stuck`

### Extension points

[](#extension-points)

- `Importable`
- `BeforeHook`
- `AfterHook`
- `Authenticates`
- `Authorizes`

Depends On
----------

[](#depends-on)

Required Enso packages:

- [`laravel-enso/core`](https://docs.laravel-enso.com/backend/core.html) [↗](https://github.com/laravel-enso/core)
- [`laravel-enso/dynamic-methods`](https://docs.laravel-enso.com/backend/dynamic-methods.html) [↗](https://github.com/laravel-enso/dynamic-methods)
- [`laravel-enso/enums`](https://docs.laravel-enso.com/backend/enums.html) [↗](https://github.com/laravel-enso/enums)
- [`laravel-enso/excel`](https://docs.laravel-enso.com/backend/excel.html) [↗](https://github.com/laravel-enso/excel)
- [`laravel-enso/files`](https://docs.laravel-enso.com/backend/files.html) [↗](https://github.com/laravel-enso/files)
- [`laravel-enso/helpers`](https://docs.laravel-enso.com/backend/helpers.html) [↗](https://github.com/laravel-enso/helpers)
- [`laravel-enso/io`](https://docs.laravel-enso.com/backend/io.html) [↗](https://git.xtelecom.ro/laravel-enso/io)
- [`laravel-enso/mails`](https://github.com/laravel-enso/mails) [↗](https://github.com/laravel-enso/mails)
- [`laravel-enso/migrator`](https://docs.laravel-enso.com/backend/migrator.html) [↗](https://github.com/laravel-enso/migrator)
- [`laravel-enso/select`](https://docs.laravel-enso.com/backend/select.html) [↗](https://github.com/laravel-enso/select)
- [`laravel-enso/tables`](https://docs.laravel-enso.com/backend/tables.html) [↗](https://github.com/laravel-enso/tables)
- [`laravel-enso/track-who`](https://docs.laravel-enso.com/backend/track-who.html) [↗](https://github.com/laravel-enso/track-who)

Required external package:

- [`openspout/openspout`](https://github.com/openspout/openspout) [↗](https://github.com/openspout/openspout)

Companion frontend package:

- [`@enso-ui/data-import`](https://docs.laravel-enso.com/frontend/data-import.html) [↗](https://github.com/enso-ui/data-import)

Contributions
-------------

[](#contributions)

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance92

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

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

Recently: every ~0 days

Total

448

Last Release

38d ago

Major Versions

1.3.23 → 2.5.92018-12-22

2.5.9 → 3.0.02019-01-13

3.0.35 → 4.0.02019-03-08

4.4.24 → 5.0.02020-06-26

5.9.2 → 6.0.02022-02-25

PHP version history (2 changes)1.0.0PHP &gt;=5.6.4

1.1.5PHP &gt;=7.1.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16073274?v=4)[Adrian Ocneanu](/maintainers/aocneanu)[@aocneanu](https://github.com/aocneanu)

---

Top Contributors

[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (506 commits)")[![gandesc](https://avatars.githubusercontent.com/u/14071925?v=4)](https://github.com/gandesc "gandesc (92 commits)")[![raftx24](https://avatars.githubusercontent.com/u/10864136?v=4)](https://github.com/raftx24 "raftx24 (62 commits)")[![vmcvlad](https://avatars.githubusercontent.com/u/37445394?v=4)](https://github.com/vmcvlad "vmcvlad (45 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (19 commits)")[![AbdullahiAbdulkabir](https://avatars.githubusercontent.com/u/33360580?v=4)](https://github.com/AbdullahiAbdulkabir "AbdullahiAbdulkabir (14 commits)")[![jpractice](https://avatars.githubusercontent.com/u/35538605?v=4)](https://github.com/jpractice "jpractice (14 commits)")[![DevIonut](https://avatars.githubusercontent.com/u/19207797?v=4)](https://github.com/DevIonut "DevIonut (9 commits)")[![GITmanuela](https://avatars.githubusercontent.com/u/44998004?v=4)](https://github.com/GITmanuela "GITmanuela (8 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")[![hirsty](https://avatars.githubusercontent.com/u/1475745?v=4)](https://github.com/hirsty "hirsty (1 commits)")

---

Tags

excel-importexcel-importerlaravellaravel-ensolaravel-excellaravel-packagelaravel-xlsdata-importlaravel-ensoexcel-importexcel-importer

### Embed Badge

![Health badge](/badges/laravel-enso-dataimport/health.svg)

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

###  Alternatives

[laravel-enso/data-import

Excel Importer dependency for Laravel Enso

2043.6k6](/packages/laravel-enso-data-import)[laravel-enso/localisation

Language and translation management for Laravel Enso

1362.3k11](/packages/laravel-enso-localisation)[laravel-enso/core

The backend shell of a Laravel Enso application

3464.9k201](/packages/laravel-enso-core)[laravel-enso/tables

Server-side data tables and export backend for Laravel Enso

63254.7k81](/packages/laravel-enso-tables)[laravel-enso/tutorials

Tutorial management backend for Laravel Enso

1140.4k](/packages/laravel-enso-tutorials)[laravel-enso/documents

Documents Manager for Laravel Enso

2040.7k1](/packages/laravel-enso-documents)

PHPackages © 2026

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