<?php

namespace Database\Seeders;

use App\Models\HeroSection;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class HeroSectionSeeder extends Seeder
{
    protected $data = [
        'title' => 'Título Sección Hero',
        'description' => 'La descripción para la sección hero',
        'link' => '#',
        'button_text' => 'Texto del botón',
        'background_url' => 'https://images.unsplash.com/photo-1571772996211-2f02c9727629?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80',
    ];

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $hero = HeroSection::query()->first() ?? new HeroSection;

        $hero->fill($this->data)->save();
    }
}
