<?php

namespace App\Models;

use App\Casts\DocDataCast;
use Illuminate\Database\Eloquent\Casts\AsArrayObject;
use Illuminate\Database\Eloquent\Casts\AsCollection;
use Illuminate\Database\Eloquent\Casts\AsStringable;
use Illuminate\Database\Eloquent\Casts\Json;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Docum extends Model
{
    use HasFactory;

    //link to table
    protected $table = "DOCUMS";

    //link to PK
    protected $primaryKey= 'RID';

    //dates
    const CREATED_AT = 'DATE_CREATED';

    const UPDATED_AT = 'DATE_MODIFIED';

    protected $casts = [
        'RID' => 'integer',
        'DOC_REKV' =>  AsCollection::class,
    ];
  public function human(): BelongsTo
    {
        return $this->belongsTo(Human::class);
    }
}
