PHP code example of innoflash / steroid-seeder

1. Go to this page and download the library: Download innoflash/steroid-seeder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

innoflash / steroid-seeder example snippets


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

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

// took 8.8 seconds to seed 10k entries

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

// took 4.3 seconds to seed 10k entries

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

    steroidFactory(TestModel::class)
            ->with(Comment::class)
            ->with(Reaction::class, 1, [], 'model_id')
            ->create();
 php
// with default factory (approx 37 seconds on my computer)

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