<?php

declare(strict_types=1);

namespace Database\Seeders;


use App\Models\User;
use Illuminate\Database\Seeder;
use Mortezaa97\Sliders\Models\Slide;
use Mortezaa97\Sliders\Models\Slider;

class SlidesTableProductSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        $slider = Slider::where('name', 'products-landing-page-slider')->first();
        $admin = User::role('admin')->first();

        Slide::updateOrCreate([
            'title' => 'اسلاید ۱',
            'url' => '#',
            'slider_id' => $slider->id,
            'image' => 'files/default_slide.jpg',
            'created_by' => $admin->id,
        ]);

        Slide::updateOrCreate([
            'title' => 'اسلاید ۲',
            'url' => '#',
            'slider_id' => $slider->id,
            'image' => 'files/default_slide.jpg',
            'created_by' => $admin->id,
        ]);

        Slide::updateOrCreate([
            'title' => 'اسلاید ۳',
            'url' => '#',
            'slider_id' => $slider->id,
            'image' => 'files/default_slide.jpg',
            'created_by' => $admin->id,
        ]);
    }
}
