<?php

namespace App\Models\Claim;

use App\Models\Institution\Institution;
use App\Trait\BelongsToSolicitor;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class CareSetting extends Model {
    public $fillable = [
        'solicitor_id',
        'claim_id',
        'institution_id',
        'dates',
        'people_involved',
        'statement'
    ];

    use BelongsToSolicitor, SoftDeletes;

    public function institution() {
        return $this->belongsTo(Institution::class);
    }

    public function claim() {
        return $this->belongsTo(Claim::class);
    }

    public function statementHistory() {
        return $this->hasMany(CareSettingStatementHistory::class)->latest();
    }
}
