This commit is contained in:
64
api/app/Models/Cadastro/SujeitoAtencao/Obito.php
Normal file
64
api/app/Models/Cadastro/SujeitoAtencao/Obito.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user