Files
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

65 lines
1.2 KiB
PHP

<?php
namespace App\Models\Cadastro\SujeitoAtencao;
use App\Models\Cadastro\SujeitoAtencao\Cidadao;
use App\Models\Model;
use App\Models\Sigtap\Cid;
use Illuminate\Database\Eloquent\SoftDeletes;
class Obito extends Model
{
use SoftDeletes;
protected $table = 'cadastro_obito';
protected $fillable = [
'cidadao_id',
'usuario_id',
'obito_em',
'declaracao',
'causa',
'cid_id',
];
protected $hidden = [
'created_at',
'created_lotacao_id',
'created_centro_custo_id',
'updated_at',
'updated_lotacao_id',
'updated_centro_custo_id',
'deleted_at',
'deleted_lotacao_id',
'deleted_centro_custo_id',
];
protected $casts = [
'obito_em' => 'datetime',
];
protected $with = [
'cid'
];
public function cidadao()
{
return $this->belongsTo(Cidadao::class);
}
public function usuario()
{
return $this->belongsTo(Usuario::class);
}
public function cid()
{
return $this->belongsTo(Cid::class);
}
public function getIsAllowedToDeleteAttribute()
{
return true;
}
}