<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class MicrositeSetting extends Model
{
    use HasFactory;

    protected $fillable = [
        'seller_id',
        'tagline',
        'cta_text',
        'cta_link',
        'show_stats',
        'years_in_business',
        'happy_clients',
        'products_sold',
        'employees_count',
        'market_cover',
        'show_about',
        'show_products',
        'show_certificates',
        'show_testimonials',
        'show_faq',
        'show_video',
        'show_contact',
        'video_url',
        'video_title',
        'brochure_path',
        'page_views',
        'inquiry_count',
        'meta_title',
        'meta_description',
        'meta_keywords',
    ];

    protected $casts = [
        'show_stats' => 'boolean',
        'show_about' => 'boolean',
        'show_products' => 'boolean',
        'show_certificates' => 'boolean',
        'show_testimonials' => 'boolean',
        'show_faq' => 'boolean',
        'show_video' => 'boolean',
        'show_contact' => 'boolean',
    ];

    public function seller()
    {
        return $this->belongsTo(Seller::class);
    }

    public function incrementViews()
    {
        $this->increment('page_views');
    }

    public function incrementInquiries()
    {
        $this->increment('inquiry_count');
    }
}
