PHPackages                             innoflash/steroid-seeder - 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. innoflash/steroid-seeder

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

innoflash/steroid-seeder
========================

A Laravel package to speed up seeding in Laravel.

v1.1.1(5y ago)2158MITPHPPHP ^7.1CI failing

Since Jun 25Pushed 5y ago2 watchersCompare

[ Source](https://github.com/innoflash/steroid-seeder)[ Packagist](https://packagist.org/packages/innoflash/steroid-seeder)[ Docs](https://github.com/innoflash/steroid-seeder)[ RSS](/packages/innoflash-steroid-seeder/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

About Steroid-Seeder
====================

[](#about-steroid-seeder)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ce18da4282e1bbda9a7a85e40a39978745950302791d4b481013d46810644d37/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e6e6f666c6173682f737465726f69642d7365656465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/innoflash/steroid-seeder)[![Build Status](https://camo.githubusercontent.com/57d32713ad3e95c71a46c84f076c2a4953ea3a29c26d4e26bcfdeb03852aae36/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696e6e6f666c6173682f737465726f69642d7365656465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/innoflash/steroid-seeder)[![Quality Score](https://camo.githubusercontent.com/aa6a91ac3e8838e92a92f571c388672cebbf13af693f98298667dbb9aa7eaf45/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696e6e6f666c6173682f737465726f69642d7365656465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/innoflash/steroid-seeder)[![Total Downloads](https://camo.githubusercontent.com/aab71c7b5afd11316089c332da6b715d959b42a108ab963d715cbbe6f8ff7580/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e6e6f666c6173682f737465726f69642d7365656465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/innoflash/steroid-seeder)

This package is built to reduce the time taken when seeding a lot data to the database on development.

 [![](https://raw.githubusercontent.com/innoflash/steroid-seeder/master/images/carbon.png "Steroid Seeder")](https://raw.githubusercontent.com/innoflash/steroid-seeder/master/images/carbon.png)

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

[](#installation)

You can install the package via composer:

```
composer require innoflash/steroid-seeder --dev
```

Usage
-----

[](#usage)

Used the same way we do with default Laravel `factory`

> If you wanna use it in your existing seeding files just replace `factory` with `steroidFactory`
>
> Alternatively you can call the factory from the facade. `SteroidSeeder::factory`

Default `factory` seeds one model at a time and that elongates the time of execution for huge data-sets.

```
// with default factory (approx 37 seconds on my computer)

factory(TestModel::class, 1000)->create();
```

```
//with steroidFactory (approx 8 seconds on my machine)

steroidFactory(\App\TestModel::class, 1000)->create();
```

##### Steroid seeder optimization.

[](#steroid-seeder-optimization)

- By default the `steroidFactory` save 1000 entries at a go, you cant tune this to whatever size that works for you.

```
// took 8.8 seconds to seed 10k entries

steroidFactory(\App\TestModel::class, 100000)
    ->chunk(1000)
    ->create();
```

- By default the Laravel factory calls some callbacks after creating your models. This is when the model boot and observers are called and its time consuming because the factory iterate over all the created models. steroidFactory lets you ignore the callbacks.

```
// took 4.3 seconds to seed 10k entries

steroidFactory(\App\TestModel::class, 100000)
    ->skipAfterCreatingCallbacks()
    ->create();
```

### Seeding relationships

[](#seeding-relationships)

Steroid seeder can be used to create models with their relationships.

It's a continuation of the above except that the you will need to chain your relationships on the factory. See the example below:

```
    steroidFactory(TestModel::class)
            ->with(Comment::class)
            ->with(Reaction::class, 1, [], 'model_id')
            ->create();
```

Here is the params expected in the `with` function.

PositionVariableTypeRequiredDefaultDescription`1``$class``string``true``null`The class name of the model to be related with the model in create.`2``$size``int``false``1`The number of models to be seeded with the parent in`create`.`3``$attributes``array``false``[]`The default attributes to set to the models.`4``$foreignKeyName``string``false`parent keyThe name of the parent's foreign key column name in the models to be seeded.### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Innocent Mazando](https://github.com/innoflash)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

2146d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8e29b914f8f1d668deae9012300d28e42e540dad3791f76eeb940a81e7447dd?d=identicon)[innoflash](/maintainers/innoflash)

---

Top Contributors

[![innoflash](https://avatars.githubusercontent.com/u/12772919?v=4)](https://github.com/innoflash "innoflash (35 commits)")

---

Tags

innoflashlaravel seedingsteroid seeder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/innoflash-steroid-seeder/health.svg)

```
[![Health](https://phpackages.com/badges/innoflash-steroid-seeder/health.svg)](https://phpackages.com/packages/innoflash-steroid-seeder)
```

###  Alternatives

[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)[aglipanci/laravel-eloquent-case

Adds CASE statement support to Laravel Query Builder.

115157.2k](/packages/aglipanci-laravel-eloquent-case)

PHPackages © 2026

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