PHPackages                             chriskelemba/excel-import-laravel - 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. chriskelemba/excel-import-laravel

ActiveLibrary[File &amp; Storage](/categories/file-storage)

chriskelemba/excel-import-laravel
=================================

Dynamic CSV/XLSX import package for Laravel with generic table mapping and preview

v0.3.0(3mo ago)01MITPHPPHP ^8.2

Since Mar 5Pushed 3mo agoCompare

[ Source](https://github.com/chriskelemba/excel-import-laravel)[ Packagist](https://packagist.org/packages/chriskelemba/excel-import-laravel)[ RSS](/packages/chriskelemba-excel-import-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Dynamic Importer for Laravel
============================

[](#dynamic-importer-for-laravel)

Backend package for dynamic CSV/XLSX preview and import into any configured database table.

Install
-------

[](#install)

```
composer require chriskelemba/excel-import-laravel
```

Publish config
--------------

[](#publish-config)

```
php artisan vendor:publish --tag=dynamic-importer-config
```

Configure (Optional)
--------------------

[](#configure-optional)

`config/dynamic-importer.php`

```
'discovery' => [
    'allow_unconfigured_tables' => true,
    'allow_tables' => [], // optional allow-list
    'exclude_tables' => ['migrations'],
],

// Optional strict per-table overrides
'tables' => [
    'skills' => [
        'required' => ['name'],
        'unique_by' => ['name'],
        'mode' => 'upsert',
    ],
],
```

MongoDB Support
---------------

[](#mongodb-support)

Install in your Laravel app:

```
composer require mongodb/laravel-mongodb
```

Configure a `mongodb` connection in `config/database.php`, then pass `connection=mongodb` in importer requests.

Notes:

- SQL connections auto-discover table columns/types via schema introspection.
- MongoDB collections are schema-less; prefer defining `columns` in `dynamic-importer.tables`.
- If `columns` are not configured, importer will infer top-level keys from sample documents.

Endpoints
---------

[](#endpoints)

- `GET /imports/databases?connection=mongodb&table=loans`
- `GET /imports/template?table=skills&connection=mysql`
- `POST /imports/preview`
- `POST /imports/run`
- `POST /imports/run-multi`

### Preview payload

[](#preview-payload)

`multipart/form-data`:

- `file`: csv/txt/xlsx
- `table`: configured table name
- `connection` (optional): Laravel DB connection name (e.g. `mysql`, `mongodb`)
- `column_map`: map of `excel_header => db_column`
- `static_values` (optional): fixed values applied to every imported row (e.g. `ctg_id => 2`)
- `header_row` (optional, 1-based)
- `sheet_index` (optional, default `0`)
- `sample_rows` (optional)

### Run payload

[](#run-payload)

`multipart/form-data`:

- `file`
- `table`
- `connection` (optional)
- `column_map`
- `static_values` (optional object)
- `header_row` (optional)
- `sheet_index` (optional)
- `mode` (optional: `insert` or `upsert`)
- `unique_by` (optional array for upsert)

### Multi-table run payload

[](#multi-table-run-payload)

`multipart/form-data`:

- `file`
- `connection` (optional global connection)
- `imports[0][table]`
- `imports[0][column_map][Loan No]`
- `imports[0][column_map][Customer]`
- `imports[0][mode]`
- `imports[0][unique_by][0]`
- `imports[0][static_values][ctg_id]` (optional fixed value / foreign key)
- `imports[1][table]`
- `imports[1][column_map][...]`

### Database preview

[](#database-preview)

Use `GET /imports/databases` to drive UI selectors:

- `connection` (optional): selected database connection (`mysql`, `mongodb`, ...)
- `table` (optional): returns selected table/collection definition including columns

Notes
-----

[](#notes)

- CSV support works out of the box.
- XLSX support requires `phpoffice/phpspreadsheet`.
- XLSX preview grid includes style/merge metadata (`style`, `rowspan`, `colspan`, `skip`) when available from reader output.
- By default, any existing DB table can be imported (dynamic schema discovery).
- Use `discovery.allow_tables` / `discovery.exclude_tables` for restrictions.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance79

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Total

3

Last Release

111d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/151122714?v=4)[chriskelemba](/maintainers/chriskelemba)[@chriskelemba](https://github.com/chriskelemba)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/chriskelemba-excel-import-laravel/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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