<?php

namespace Database\Seeders;

use App\Models\MediaCollection;
use Illuminate\Database\Seeder;

class MediaCollectionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // Define an array of mock records

        $media_config = config('platform.media');

        foreach ($media_config as $key => $item) {

            // dd($item);

            $media_collection = MediaCollection::where('key', $key)->first();

            if (is_null($media_collection)) {
                $media_collection = MediaCollection::create([
                    'key' => $key,
                    'name' => $item['name'],
                    'description' => $item['description'],
                    'is_system' => $item['is_system'],
                ]);
            }
        }
    }
}
