<?php

namespace Database\Seeders;

use App\Models\Library\BookApi;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class OpenApiTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // if (\App::environment('local')) {
        //     BookApi::truncate();
        // }

        $types = [
            [
                'api_provider_name' => 'Open Laibrary',
                'provider_id'       => 'OPENLIB',
                'base_url'          => 'https://openlibrary.org/api/volumes/brief',
                'exyention'         => 'json',
                'veriables'         => 'isbn',
                'is_default'        => '0',
                'status'            => '1'
            ],
        ];

        foreach ($types as $value) {
            BookApi::firstOrCreate($value);
        }
    }
}
