<?php

namespace Database\Seeders;

use App\Domains\Tenant\Models\SocialMedia;
use Illuminate\Database\Seeder;

class SocialMediaSeeder extends Seeder
{
    public function run(): void
    {
        $socialMedia = [
            [
                'code' => 'facebook',
                'icon' => 'fa-brands fa-facebook',
                'name' => 'Facebook',
            ],
            [
                'code' => 'instagram',
                'icon' => 'fa-brands fa-instagram',
                'name' => 'Instagram',
            ],
            [
                'code' => 'whatsapp',
                'icon' => 'fa-brands fa-whatsapp',
                'name' => 'WhatsApp',
            ],
            [
                'code' => 'linkedin',
                'icon' => 'fa-brands fa-linkedin-in',
                'name' => 'LinkedIn',
            ],
        ];

        foreach ($socialMedia as $socialMediaData) {
            SocialMedia::query()->updateOrCreate(
                ['code' => $socialMediaData['code']],
                $socialMediaData
            );
        }
    }
}
