<?php

namespace Database\Seeders;

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

class FileBucketSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $buckets = config('file_upload.default_buckets', []);

        foreach ($buckets as $bucket) {
            FileBucket::firstOrCreate(
                ['name' => $bucket['name']],
                [
                    'display_name' => $bucket['display_name'],
                    'description' => $bucket['description'],
                    'visibility' => $bucket['visibility'],
                    'is_active' => true,
                ]
            );
        }

        $this->command->info('Default file buckets created successfully.');
    }
}
