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 6d 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

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

3316d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3222a40774e99df295dc842ab4886dc891a52f96da3ad05d7f89b6fe4018bc00?d=identicon)[DPC](/maintainers/DPC)

---

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.8k52.4M9.4k](/packages/illuminate-database)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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