<?php

namespace Database\Seeders;

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

class SliderSeeder extends Seeder
{
    public function run(): void
    {
        $slides = [
            [
                'image_path' => 'sliders/home_slider_bg-1.jpg',
                'title' => 'For Multiple Languages Requirements',
                'subtitle' => 'Most companies come to us!',
                'sort_order' => 0,
            ],
            [
                'image_path' => 'sliders/Home-slider-2.jpg',
                'title' => 'Cheapest Prices in the World',
                'subtitle' => 'As supplier to translation companies',
                'sort_order' => 1,
            ],
            [
                'image_path' => 'sliders/Home-slider1.jpg',
                'title' => 'Those Who Try Us,',
                'subtitle' => 'Remain with us!',
                'sort_order' => 2,
            ],
            [
                'image_path' => 'sliders/homeslider4-1.jpg',
                'title' => 'An All Women Company',
                'subtitle' => '18/6 working hours — rare languages — self-imposed penalty on non delivery',
                'sort_order' => 3,
            ],
        ];

        foreach ($slides as $slide) {
            Slider::updateOrCreate(
                ['title' => $slide['title']],
                [
                    'image_path' => $slide['image_path'],
                    'subtitle' => $slide['subtitle'],
                    'sort_order' => $slide['sort_order'],
                    'is_active' => true,
                    'link_url' => null,
                ]
            );
        }
    }
}
