<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Modules\Quotes\Quote;

class QuotesSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // Original hardcoded quotes from BookingsController
        $quotes = [
            [
                'text' => 'A gem is not polished without rubbing, nor a man perfected without trials',
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => "A child's life is like a piece of paper on which every person leaves a mark.",
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => 'He who asks is a fool for five minutes, but he who does not ask remains a fool forever.',
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => 'If you are patient in one moment of anger, you will escape a hundred days of sorrow.',
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => "Do not remove a fly from your friend's forehead with a hatchet.",
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => "Don't trust an American who runs a computer shop",
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => 'A drop of water shall be returned with a burst of spring.',
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => "If the wind comes from an empty cave, it's not without a reason.",
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => 'There are secrets within lies, answers within riddles. Open your mind and hear what your heart wants to deny.',
                'author' => 'Unknown',
                'category' => 'Default',
            ],
            [
                'text' => 'Mists of dreams drip along the nascent echo and love no more.',
                'author' => 'Unknown',
                'category' => 'Default',
            ],
        ];

        foreach ($quotes as $quoteData) {
            // Check if quote already exists to avoid duplicates
            if (!Quote::existsByText($quoteData['text'])) {
                Quote::create($quoteData);
            }
        }

        $this->command->info('Seeded ' . count($quotes) . ' quotes.');
    }
}