PHP code example of laravel-enso / dataimport

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

    

laravel-enso / dataimport example snippets


'configs' => [
    'userGroups' => [
        'label' => 'User Groups',
        'template' => 'app/Imports/Templates/userGroups.json',
    ],
],

'seederUserId' => env('DATA_IMPORT_SEEDER_USER_ID', 1),

use LaravelEnso\DataImport\Contracts\Importable;
use LaravelEnso\DataImport\Models\Import;
use LaravelEnso\Helpers\Services\Obj;

class UserGroupImporter implements Importable
{
    public function run(Obj $row, Import $import)
    {
        UserGroup::create($row->all());
    }
}
bash
php artisan migrate