PHP code example of bluekachina / seedfromjson

1. Go to this page and download the library: Download bluekachina/seedfromjson 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/ */

    

bluekachina / seedfromjson example snippets

bash
php artisan vendor:publish --tag=config

function addModelToSeedingQueue($model, $options = 0, $callback_pre = null, $callback_post = null);

function beginSeeding($defer=false);

    public function run(): void
    {
        $batch_silent = true;
        $batch_payload = ['defer' => true];

        $this->call(Example1Seeder::class,      $batch_silent,   $batch_payload);
        $this->call(Example2Seeder::class,      $batch_silent,   $batch_payload);

        // Start seeding based on the queue of JSON files we just lined up
        app(SeedFromJSON::class)->beginSeeding();
    }