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

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

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

Framework-agnostic CSV/XLSX/JSON import package for PHP

v0.5.0(6d ago)06↓100%MITPHPPHP ^8.2

Since Mar 12Pushed 6d agoCompare

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

READMEChangelog (5)Dependencies (2)Versions (8)Used By (0)

Excel Import (Framework-Agnostic PHP)
=====================================

[](#excel-import-framework-agnostic-php)

Standalone CSV/XLSX/JSON/NDJSON preview + import engine for PHP.

This is the same core functionality as `excel-import-laravel`, extracted so it can run in:

- plain PHP projects
- Laravel (service/controller wrapper in app code)
- Yii (service/controller wrapper in app code)

Install
-------

[](#install)

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

Optional:

```
composer require phpoffice/phpspreadsheet   # XLSX support
composer require mongodb/mongodb            # MongoDB support
```

Database Support
----------------

[](#database-support)

Supported through `PDO` adapters:

- MySQL / MariaDB (`pdo_mysql`)
- PostgreSQL (`pdo_pgsql`)
- SQLite (`pdo_sqlite`)
- SQL Server (`pdo_sqlsrv`)

Supported through Mongo adapter:

- MongoDB (`mongodb/mongodb` package)

Notes:

- Register one or many connections and switch by `connection` parameter in service calls.
- `insert` and `upsert` modes work across the supported SQL drivers and MongoDB.
- Column/type discovery is automatic for SQL tables.
- MongoDB is schema-less; columns are inferred from sampled documents unless overridden in config.

Quick Start (Plain PHP + PDO)
-----------------------------

[](#quick-start-plain-php--pdo)

```
