New-Thanasoft/thanasoft-back/app/Models/DeceasedDocument.php
2025-11-11 17:45:58 +03:00

50 lines
943 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class DeceasedDocument extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'deceased_id',
'doc_type',
'file_id',
'generated_at'
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'generated_at' => 'datetime'
];
/**
* Get the deceased associated with the document.
*/
public function deceased(): BelongsTo
{
return $this->belongsTo(Deceased::class);
}
/**
* Get the file associated with the document.
*/
public function file(): BelongsTo
{
return $this->belongsTo(File::class);
}
}