PHPackages                             alfonsobries/laravel-spreadsheet-importer - 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. alfonsobries/laravel-spreadsheet-importer

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

alfonsobries/laravel-spreadsheet-importer
=========================================

Sheetjs Laravel Spreadsheet Importer

1.2.0(5y ago)17692[1 PRs](https://github.com/alfonsobries/laravel-spreadsheet-importer/pulls)MITPHPPHP ^7.2.5

Since Jul 2Pushed 5y agoCompare

[ Source](https://github.com/alfonsobries/laravel-spreadsheet-importer)[ Packagist](https://packagist.org/packages/alfonsobries/laravel-spreadsheet-importer)[ Docs](https://github.com/alfonsobries/laravel-spreadsheet-importer)[ RSS](/packages/alfonsobries-laravel-spreadsheet-importer/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (17)Used By (0)

Laravel Faster Spreadsheet Importer
===================================

[](#laravel-faster-spreadsheet-importer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/50c2f52f5c74270d7de630461988e8a2486dd676d500ecf527eb0d550398ccf2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c666f6e736f62726965732f6c61726176656c2d73707265616473686565742d696d706f727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alfonsobries/laravel-spreadsheet-importer)

This package works together with the [xlsx-laravel-spreadsheet-importer](https://github.com/alfonsobries/xlsx-laravel-spreadsheet-importer) CLI tool to quickly import spreadsheets from xlsx files an other [compatible formats](https://www.npmjs.com/package/xlsx#file-formats) and then store the values into temporal database tables that are way easier to work with.

Because we use Node instead of PHP we can import larger xlsx files in just a few seconds, and because we will work with a SQL table the operations with the data are **considerably** faster.

- Includes a command that expect the data according to the cli tool and trigger an observable event with the progress of the import.
- Adds a Trait that add the ability to your model to work with the temporal data as easy as any Eloquent relationship.
- Once the import is finished triggers another observable event so you can know when you can continue with the following operations related with your import.
- Manages multiple files format, see ()
- Compatible with PostgreSQL as MySQL

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

[](#installation)

You can install the package via composer:

```
composer require alfonsobries/laravel-spreadsheet-importer
```

You also will need the npm package ([check alfonsobries/xlsx-laravel-spreadsheet-importer for more info](https://github.com/alfonsobries/xlsx-laravel-spreadsheet-importer))

```
npm install @alfonsobries/xlsx-laravel-spreadsheet-importer --save
```

Optionally publish the config files by running:

```
php artisan vendor:publish --provider="Alfonsobries\LaravelSpreadsheetImporter\LaravelSpreadsheetImporterServiceProvider" --tag="config"
```

Configure your model
--------------------

[](#configure-your-model)

The files that you will import usually will be associated to one Model, also your Model will be used to store the progress of the import.

Start by adding the `InteractsWithImporter` trait and the `Importable` contract to the Model.

You will also need to define the methods in the `Importable` contract

```
