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

49 lines
912 B
PHP

<?php
namespace App\Models\Sigtap;
use App\Models\Cadastro\SujeitoAtencao\Lotacao;
use App\Models\ProntoAtendimento\Atendimento\Recepcao;
use Illuminate\Database\Eloquent\Model;
class Ocupacao extends Model
{
protected $connection = 'sigtap';
protected $table = 'ocupacao';
protected $fillable = [
'codigo',
'nome'
];
protected $hidden = [
'created_at',
'updated_at'
];
protected $appends = [
'codigo_nome'
];
public function procedimentos()
{
return $this->belongsToMany(Procedimento::class, 'procedimento_ocupacao');
}
public function lotacoes()
{
return $this->hasMany(Lotacao::class);
}
public function recepcoes()
{
return $this->hasMany(Recepcao::class);
}
public function getCodigoNomeAttribute()
{
return "{$this->codigo} - {$this->nome}";
}
}