<?php

namespace App\Models;

use App\Concerns\HasTranslations;
use Illuminate\Database\Eloquent\Model;

class Contact extends Model
{
    use HasTranslations;

    protected $table = 'contact';

    protected $primaryKey = 'ctc_id';

    protected string $columnPrefix = 'ctc';

    const CREATED_AT = 'ctc_created_at';

    const UPDATED_AT = 'ctc_updated_at';

    protected $fillable = [
        'ctc_title_fr', 'ctc_title_en', 'ctc_intro_fr', 'ctc_intro_en',
        'ctc_email', 'ctc_whatsapp', 'ctc_whatsapp_url',
        'ctc_localisation_fr', 'ctc_localisation_en',
        'ctc_call_label_fr', 'ctc_call_label_en', 'ctc_call_texte_fr', 'ctc_call_texte_en',
        'ctc_rgpd_fr', 'ctc_rgpd_en',
    ];

    public static function singleton(): self
    {
        return static::query()->firstOrNew([], ['ctc_id' => 1]);
    }
}
