PHPackages                             dpc/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. [Database &amp; ORM](/categories/database)
4. /
5. dpc/importer

ActiveLibrary[Database &amp; ORM](/categories/database)

dpc/importer
============

Laravel package for importing data from another database

v1.0.0(9y ago)11323MITPHPPHP ^7.0

Since Apr 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Dylan-DPC/Importer)[ Packagist](https://packagist.org/packages/dpc/importer)[ RSS](/packages/dpc-importer/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/f049b5e3688136661f325549a50a94efbbbdb7b7cc211853744e98c902390727/68747470733a2f2f706f7365722e707567782e6f72672f6470632f696d706f727465722f642f746f74616c2e737667)](https://packagist.org/packages/dpc/importer)[![Latest Stable Version](https://camo.githubusercontent.com/18fecad130f3d0a5aeb81e75d5082f2b418f12348c822c242375a20b418e4af6/68747470733a2f2f706f7365722e707567782e6f72672f6470632f696d706f727465722f762f737461626c652e737667)](https://packagist.org/packages/dpc/importer)[![License](https://camo.githubusercontent.com/419363728c67b69e804a76db7a420979efa194d8138ad91e093c6f09c6552909/68747470733a2f2f706f7365722e707567782e6f72672f6470632f696d706f727465722f6c6963656e73652e737667)](https://packagist.org/packages/dpc/importer)

Laravel Importer
================

[](#laravel-importer)

Requirements:
-------------

[](#requirements)

- PHP 7
- Laravel 5.6

Why?
----

[](#why)

This package allows you to import data from another database locally.

The entire seeding process is run in a transaction by default

How?
----

[](#how)

### Installation:

[](#installation)

Use composer to install the package:

```
composer require dpc/importer

```

Install the service provider in your config file (config/app.php)

```
'providers' => [
    ....
    Dpc\Importer\Providers\ImporterServiceProvider::class,
];

```

Publish the vendor files by running:

```
php artisan vendor:publish

```

This will create an `importer.php` config file in config directory

### Initialization:

[](#initialization)

Make sure you have created a new database connection for your temporary database (from where you want to import the data) and it contains the required data.

You need to set up the connection name along with the array of the seeders in the config file. The array will determine the order in which the seeders run.

An example of the config file:

```
return [
    'connection' => 'temp',

    'seeds' => [
        \App\Seeds\UserSeeder::class,
        \App\Seeds\PostSeeder::class,
    ]
];

```

### Creating The Seeders:

[](#creating-the-seeders)

Create your own Seeder class that extends `Dpc\Importer\AbstractSeed`.

The Seeder class should implement these 2 methods:

`getData()`: This function is responsible for fetching the data from the database into the seeder. This function does not return the data but an instance of the seeder. The data is available in `$this->data`

`seed()` : This function is called after data is loaded into the class property. Define your seeding process here.

`prepareData()` : This is an optional function that is called before the data is seeded. Can be used to

The connection is injected into the seeds so you can use `$this->manager->table()` to access the data in the temporary database.

The entire seeding operation is wrapped inside a transaction.

### Running The Seeds:

[](#running-the-seeds)

To run the seeds:

```
php artisan importer:import

```

### Lastly....

[](#lastly)

Do star this repo. It means a lot to the author (oh wait.. that's me :P )

What's Next?
============

[](#whats-next)

- Data Chunking
- Flexibility to queue the seeders
- Option to run using a cron job

Wanna Contribute?
=================

[](#wanna-contribute)

Not fussy about standards so just drop in a PR.

If you find any issues or want to make future proposals, create an issue here.

Wanna contact me?
=================

[](#wanna-contact-me)

- Twitter: [ @DPC\_22 ](https://twitter.com/DPC_22)
- Email:

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.3% 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

3362d ago

### Community

Maintainers

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

---

Top Contributors

[![Dylan-DPC](https://avatars.githubusercontent.com/u/99973273?v=4)](https://github.com/Dylan-DPC "Dylan-DPC (25 commits)")[![BEY9S](https://avatars.githubusercontent.com/u/7118356?v=4)](https://github.com/BEY9S "BEY9S (2 commits)")[![koenhoeijmakers](https://avatars.githubusercontent.com/u/2232776?v=4)](https://github.com/koenhoeijmakers "koenhoeijmakers (1 commits)")

---

Tags

databaseimportlaravelphpseeds

### Embed Badge

![Health badge](/badges/dpc-importer/health.svg)

```
[![Health](https://phpackages.com/badges/dpc-importer/health.svg)](https://phpackages.com/packages/dpc-importer)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.5k](/packages/illuminate-database)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M94](/packages/mongodb-laravel-mongodb)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[lemaur/eloquent-publishing

218.1k1](/packages/lemaur-eloquent-publishing)[laravel-liberu/laravel-gedcom

A package that converts gedcom files to Eloquent models

782.5k1](/packages/laravel-liberu-laravel-gedcom)

PHPackages © 2026

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