<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 App\Models\User;
use App\Models\Center;
use App\Models\Patient;
use App\Models\Vaccine;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Appointment extends Model
{
    use HasFactory, SoftDeletes;

    protected $table        = 'appointments';
    protected $primaryKey   = 'appointment_id';

    protected $fillable = [
        "center_id",
        "user_id",
        "patient_id",
        "vaccine_id",
        "ap_date",
        "ap_matricule",
        "ap_type",
    ];

    const CREATED_AT = 'ap_created_at';
    const UPDATED_AT = 'ap_updated_at';
    const DELETED_AT = 'ap_deleted_at';

    protected $casts = [
        'ap_created_at' => 'datetime:Y-m-d m:i:s',
        'ap_updated_at' => 'datetime:Y-m-d m:i:s',
        'ap_deleted_at' => 'datetime:Y-m-d m:i:s',
    ];

    public function Center() {
        return $this->belongsTo(Center::class, 'center_id', 'center_id');
    }

    public f