<?php

namespace Database\Seeders;

use App\Models\AboutCategory;
use App\Models\Pages;
use Illuminate\Database\Seeder;
use Carbon\Carbon;

class AboutSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */

    public function run()
    {

        Pages::where('name', 'About')->delete();

        $content = [
            'name' => 'About',
            'slug' => 'about',
            'banner_image' => 'front/images/mainBanner.webp',
            'story_image1' => 'front/images/product15.jpeg',
            'story_image2' => 'front/images/product14.jpeg',
            'story_image3' => 'front/images/product11.jpeg',
            'story_image4' => 'front/images/product12.jpeg',
            'story_image5' => 'front/images/product13.jpeg',
            'story_image6' => 'front/images/product16.jpeg',
            'content' => json_encode([
                'banner_heading' => 'ABOUT US',
                'about_sto1_heading' => 'AbOUT LUXURY CANDLES',
                'about_sto1_des1' => 'Luxury Candles provide a Premium candle that permeates homes with all eco friendly and natural ingredients.
                 Luxury Candles are made to be enjoyed, shared, and stimulating, every day, every season, and every holiday. 
                 Luxury Candles is owned and operated by Antonio Yarborough-Bazemore, a Husband, a Son and a Brother.',

                'about_sto2_heading' => 'Our Values',
                'about_sto2_des1' => 'Antonio has poured his values into Luxury Candles. Growing up as a young man in Baltimore, Maryland,
                  Antonio valued hard work, determination and the value of money. Antonio has taken that determination,
                  and principle of value to create a product that will be enjoyed with quality ingredients
                   and that will be a premium product value for luxurious candle seekers.',

                'about_sto3_heading' => 'We try to make the best Luxury Candles',
                'about_sto3_des1' => '100% Coco Apricot Créme Wax.',
                'about_sto3_des2' => 'Hand Made to order',
                'about_sto3_des3' => 'Made from all-natural waxes and essential oils, ensuring a clean, eco-friendly burn.',
                'about_sto3_des4' => 'Each candle is hand-poured to perfection, reflecting the artistry and dedication of our craft.',
                'about_sto3_des5' => 'Designed to last, providing extended hours of fragrance and warmth.',
                'about_sto3_btn' => 'Learn more about us ',
               
               
                'about_sto4_heading' => 'Our Vision',
                'about_sto4_des1' => 'We strive to create candles that are not only luxurious and provide a beautiful ambiance,
                 but a candle that provides serenity and peace,
                 helping many individuals escape from the day to day stress of today’s world. Transporting each and every one of our customers to a place 
                 of relaxation and comfort, our candles allow them to indulge in the small yet simple pleasures of life.',

            ])
        ];

        $pageCollection = collect($content);

        $pageData = $pageCollection->except([
            'banner_image',
            'story_image1',
            'story_image2',
            'story_image3',
            'story_image4',
            'story_image5',
            'story_image6',


        ])->toArray();

        $aboutPage = Pages::create($pageData);
        $aboutPage->clearMediaCollection('banner_image');
        $aboutPage->addMedia(public_path($content['banner_image']))
            ->preservingOriginal()
            ->toMediaCollection('banner_image');

        $aboutPage->clearMediaCollection('story_image1');
        $aboutPage->addMedia(public_path($content['story_image1']))
            ->preservingOriginal()
            ->toMediaCollection('story_image1');

        $aboutPage->clearMediaCollection('story_image2');
        $aboutPage->addMedia(public_path($content['story_image2']))
            ->preservingOriginal()
            ->toMediaCollection('story_image2');

        $aboutPage->clearMediaCollection('story_image3');
        $aboutPage->addMedia(public_path($content['story_image3']))
            ->preservingOriginal()
            ->toMediaCollection('story_image3');

        $aboutPage->clearMediaCollection('story_image4');
        $aboutPage->addMedia(public_path($content['story_image4']))
            ->preservingOriginal()
            ->toMediaCollection('story_image4');

        $aboutPage->clearMediaCollection('story_image5');
        $aboutPage->addMedia(public_path($content['story_image5']))
            ->preservingOriginal()
            ->toMediaCollection('story_image5');

        $aboutPage->clearMediaCollection('story_image6');
        $aboutPage->addMedia(public_path($content['story_image6']))
            ->preservingOriginal()
            ->toMediaCollection('story_image6');

    }

}
