<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SchoolSetting extends Model
{
    protected $table = 'school_settings';

    protected $fillable = [
        'name', 'slogan', 'logo', 'logo_horizontal', 'logo_mode', 'hero_image', 'hero_title', 'hero_subtitle', 'hero_effect',
        'mission', 'vision', 'history', 'address', 'phone', 'email', 'schedule',
        'facebook', 'instagram', 'twitter', 'youtube', 'tiktok',
        'primary_color', 'accent_color',
        'show_levels', 'show_news', 'show_events', 'show_teachers',
        'show_gallery', 'show_videos', 'show_contact', 'show_testimonials',
        'levels_title', 'levels_subtitle',
        'news_title', 'news_subtitle',
        'events_title', 'events_subtitle',
        'teachers_title', 'teachers_subtitle',
        'gallery_title', 'gallery_subtitle',
        'videos_title', 'videos_subtitle',
        'testimonials_title', 'testimonials_subtitle',
        'show_admissions',
        'admissions_title', 'admissions_subtitle',
        'sections_order',
        'show_whatsapp',
        'whatsapp_number',
        'show_documents',
        'documents_title', 'documents_subtitle',
        'about_image1',
        'about_image2',
        'about_content',
    ];

    protected $casts = [
        'show_levels' => 'boolean',
        'show_news' => 'boolean',
        'show_events' => 'boolean',
        'show_teachers' => 'boolean',
        'show_gallery' => 'boolean',
        'show_videos' => 'boolean',
        'show_contact' => 'boolean',
        'show_testimonials' => 'boolean',
        'show_admissions' => 'boolean',
        'sections_order' => 'array',
        'show_whatsapp' => 'boolean',
        'show_documents' => 'boolean',
    ];

    public static function current(): ?self
    {
        return static::first();
    }
}
