49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Ambulatorio;
|
|
|
|
use App\Models\Model;
|
|
|
|
class Servico extends Model
|
|
{
|
|
protected $table = 'ambulatorio_servico';
|
|
|
|
protected $fillable = [
|
|
'nome',
|
|
'tipo_id',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'created_lotacao_id',
|
|
'created_centro_custo_id',
|
|
'updated_at',
|
|
'updated_lotacao_id',
|
|
'updated_centro_custo_id',
|
|
];
|
|
|
|
public function tipo()
|
|
{
|
|
return $this->belongsTo(ServicoTipo::class);
|
|
}
|
|
|
|
public function atendimentos()
|
|
{
|
|
return $this->belongsToMany(Atendimento::class, 'ambulatorio_atendimento_servico')
|
|
->using(AtendimentoServico::class)
|
|
->as('atendimentoServico')
|
|
->withTimestamps();
|
|
}
|
|
|
|
public function parametrizacoesInfraestrutura()
|
|
{
|
|
return $this->belongsToMany(
|
|
ParametrizacaoInfraestrutura::class,
|
|
'ambulatorio_parametrizacao_infraestrutura_servico'
|
|
)
|
|
->using(ParametrizacaoInfraestruturaServico::class)
|
|
->as('parametrizacaoInfraestruturaServico')
|
|
->withTimestamps();
|
|
}
|
|
}
|