<?php

namespace App\Modules\Bank\Database\Seeders;

use App\Modules\Bank\Models\Bank;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\File;

class BankTableSeeder extends Seeder
{
    /**
     * Run database seeders
     */
    public function run(): void
    {
        $data = collect(File::json(__DIR__.'/../../Resources/Data/data.json'));

        $data->each(function ($item) {
            Bank::create(['bab' => $item['key'], 'name' => $item['value']]);
        });
    }
}
