<br />
<b>Warning</b>:  Undefined variable $auth in <b>/home/pevo0181/public_html/pia-soft.com/cleania/routes/index.php</b> on line <b>542</b><br />
<br />
<b>Warning</b>:  Trying to access array offset on value of type null in <b>/home/pevo0181/public_html/pia-soft.com/cleania/routes/index.php</b> on line <b>542</b><br />
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SchoolConfiguration extends Model
{
    protected $table = 'school_configurations';
    
    protected $fillable = [
        'school_name',
        'school_name_en',
        'abbreviation',
        'motto_fr',
        'motto_en',
        'address',
        'phone',
        'email',
        'website',
        'opening_order',
        'opening_date',
        'ministry_fr',
        'ministry_en',
        'logo_path',
        'card_recto',
        'card_verso',
        'badge_parent',
        'card_color',
        'card_sign',
        'is_active',
    ];
    
    protected $casts = [
        'opening_date' => 'date',
        'is_active' => 'boolean'
    ];
    
    // Récupérer l'école active
    public static function getActiveSchool()
    {
        return self::where('is_active', true)->first();
    }
    
    // Formater la date d'ouverture
    public function getFormattedOpeningDate()
    {
        if (!$this->opening_date) return '';
        
        $months = [
         