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