<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class ContractIprsService extends Model
{
    use HasFactory;

    protected $fillable = [
        'contract_id',
        'field_id',
    ];

    /*
     * Relate service to
     * */
    public function iprsNewService(): BelongsTo
    {
        return $this->belongsTo(IprsNewService::class, 'field_id', 'id');
    }

    public function contract(): BelongsTo
    {
        return $this->belongsTo(Contract::class, 'contract_id', 'rid');
    }

}
