<?php

declare(strict_types=1);

namespace TechnoArtisan\FilamentCms\Models;

// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use TechnoArtisan\FilamentCms\Enums\PhpType;

class WebsiteSettings extends Model
{
    protected $table = 'fcms_website_settings';

    /**
     * The attributes that are mass assignable.
     *
     * @var list<string>
     */
    protected $fillable = [
        'group_id',
        'identifier',
        'value_type',
        'value',
    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var list<string>
     */
    protected $hidden = [
    ];

    public function group(): BelongsTo
    {
        return $this->belongsTo(WebsiteSettingGroup::class, 'group_id', 'id');
    }

    /**
     * Get the attributes that should be cast.
     *
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'value_type' => PhpType::class,
        ];
    }
}
