PHPackages                             arkitecht/laravel-loader - 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. [CLI &amp; Console](/categories/cli)
4. /
5. arkitecht/laravel-loader

ActiveProject[CLI &amp; Console](/categories/cli)

arkitecht/laravel-loader
========================

A data loader command base class for Laravel

6.0(4mo ago)31.9k[2 PRs](https://github.com/Arkitecht/laravel-loader/pulls)MITPHPPHP &gt;=5.6.4

Since Apr 4Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/Arkitecht/laravel-loader)[ Packagist](https://packagist.org/packages/arkitecht/laravel-loader)[ RSS](/packages/arkitecht-laravel-loader/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (12)Used By (0)

Laravel Data Loader
===================

[](#laravel-data-loader)

---

Database seeders are awesome for loading up your database with test data, but what about when you need to load **real** data into your database across environments?

You could always load that data in with migrations... but then you have to manage DB dependencies, which can get messy with relational databases, especially when doing rollbacks and resets. Plus, thats not really where they should be, and if you are using TDD (which you should be) that is not where you want them - since you probably want to create the data in your tests.

Along comes the Laravel Data Loader. You define data sources, as a Model and Unique Key(s) and then define the data. When you run the loader it will insert or update the data, preserving primary keys, and ensuring you are up to date.

Install
-------

[](#install)

That is as easy as:

```
composer require arkitecht/laravel-loader

```

Setup
-----

[](#setup)

1\. Create a new console command as normal

```
php artisan make:command YourCommandName

```

2\. Import the data loader

```
use Arkitecht\LaravelLoader\Console\LoadDataCommand;
```

3\. Change the base class of your command

```
class YourCommandName extends LoadDataCommand
```

4\. Initiate the models

```
public function __construct()
{
        parent::__construct();

        $this->addDataClass(MyModelName::class, 'uniquekey');
}
```

Each data class take the model class you will be loading in, and the column, or columns you want to match on. Under the hood we are doing an `updateOrCreate` and the data from the column(s) will be used as the $attributes sent to the method.

You can use an array for a multi dimensional unique key, ie:

```
$this->addDataClass(MultiDimensionalKeyClass::class, ['key_part_1', 'Key_part_2']);
```

5\. Load the data

```
public function handle()
{
   $this->loadData(MyModelName::class, [
       'uniquekey' => 'unique',
       'data`'     => 'data',
       'data2'     => 'data' ....
   ]);
}
```

Real world example
------------------

[](#real-world-example)

```
use App\Models\TimeZone;
use Arkitecht\LaravelLoader\Console\LoadDataCommand;

class LoadInitialData extends LoadDataCommand
{

    protected $signature = 'data:load';

    protected $description = 'Load Initial Data';

    public function __construct()
    {
           parent::__construct();

           $this->addDataClass(TimeZone::class, 'name');
    }

    public function handle()
    {
           $this->loadTimeZones();
    }

   /**
     * Load in the initial Time Zones
     *
     * @return void
     */
    public function loadTimeZones()
    {
        $this->loadData(TimeZone::class, [
            'name'   => 'Hawaii-Aleutian Standard Time',
            'code'   => 'HAST',
            'offset' => 'Pacific/Honolulu',
        ]);
        $this->loadData(TimeZone::class, [
            'name'   => 'Hawaii-Aleutian with Daylight Savings Time',
            'code'   => 'HADT',
            'offset' => 'US/Aleutian',
        ]);
        $this->loadData(TimeZone::class, [
            'name'   => 'Alaska Standard Time',
            'code'   => 'AKST',
            'offset' => 'Etc/GMT+9',
        ]);
        ....
   }
}
```

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance74

Regular maintenance activity

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 95.5% 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 ~313 days

Recently: every ~298 days

Total

9

Last Release

143d ago

Major Versions

1.1 → 2.02020-08-11

2.0 → 3.02020-10-05

3.0 → 4.02022-11-04

4.0 → 5.02023-03-03

5.2 → 6.02026-02-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66117?v=4)[Aaron Rubin](/maintainers/Arkitecht)[@Arkitecht](https://github.com/Arkitecht)

---

Top Contributors

[![Arkitecht](https://avatars.githubusercontent.com/u/66117?v=4)](https://github.com/Arkitecht "Arkitecht (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelphplaravelloader

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arkitecht-laravel-loader/health.svg)

```
[![Health](https://phpackages.com/badges/arkitecht-laravel-loader/health.svg)](https://phpackages.com/packages/arkitecht-laravel-loader)
```

###  Alternatives

[laravel/octane

Supercharge your Laravel application's performance.

4.0k26.6M223](/packages/laravel-octane)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[ronasit/laravel-entity-generator

Provided console command for generating entities.

2053.1k](/packages/ronasit-laravel-entity-generator)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3991.8k](/packages/codewithdennis-larament)

PHPackages © 2026

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