1. Go to this page and download the library: Download oi-lab/oi-laravel-seeds 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/ */
oi-lab / oi-laravel-seeds example snippets
namespace Database\Seeders;
use App\Models\Group;
use Illuminate\Database\Seeder;
use OiLab\OiLaravelSeeds\Traits\ExportableSeeder;
class GroupSeeder extends Seeder
{
use ExportableSeeder;
protected string $jsonFilename = 'groups.json';
protected string $modelClass = Group::class;
protected array $dependencies = [];
protected string $uniqueBy = 'name';
protected array $exportRelations = [];
public function run(): void
{
$this->importData();
}
}