<?php

namespace App\Modules\Pilkades\Models\Concerns;

use App\Modules\Pilkades\Models\Desa;
use App\Modules\Pilkades\Models\Scopes\DesaScope;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

trait BelongsToDesa
{
    public static function bootBelongsToDesa(): void
    {
        static::addGlobalScope(new DesaScope);
    }

    public function desa(): BelongsTo
    {
        return $this->belongsTo(Desa::class);
    }
}
