<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\Agence;
use App\Models\Alert;
use App\Models\Equipment;
use App\Models\Region;
use App\Models\Subdivision;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Department extends Model
{
    use HasFactory;

    protected $fillable = [
        "dpt_name",
        "dpt_code",
        "dpt_capital",
        "region_id",
    ];

    protected $table = 'departments';

    public $timestamps = false;
    protected $primaryKey = 'department_id';

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

    public function Subdivisions()
    {
        return $this->hasMany(Subdivision::class, "department_id", "department_id");
    }

    public function Agences()
    {
        retur