init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace App\Models\Cadastro\SujeitoAtencao;
use App\Enums\Cadastro\SujeitoAtencao\Sexo as SujeitoAtencaoSexo;
use App\Models\Model;
class Sexo extends Model
{
protected $table = 'cadastro_sexo';
public $incrementing = false;
protected $fillable = [
'id',
'descricao',
'codigo_esus',
];
protected $hidden = [
'created_at',
'updated_at',
];
protected $appends = [
'identificador'
];
public function cidadaos()
{
return $this->hasMany(Cidadao::class);
}
public function getIdentificadorAttribute()
{
if ($this->id === SujeitoAtencaoSexo::MASCULINO) {
return 'M';
}
if ($this->id === SujeitoAtencaoSexo::FEMININO) {
return 'F';
}
}
}