'boolean', ]; protected $fillable = [ 'solicitacao_id', 'exame_id', 'procedimento_cirurgico_id', 'especialidade_id', 'soap_solicitacao_item_id', 'faz_parte_oci', ]; protected $hidden = [ 'created_at', 'created_lotacao_id', 'created_centro_custo_id', 'updated_at', 'updated_lotacao_id', 'updated_centro_custo_id', ]; public function solicitacao() { return $this->belongsTo(Solicitacao::class); } public function exame() { return $this->belongsTo(Exame::class); } public function procedimentoCirurgico() { return $this->belongsTo(ProcedimentoCirurgico::class); } public function especialidade() { return $this->belongsTo(Especialidade::class); } public function getOrigemAttribute() { if (!is_null($this->exame_id)) { return 'exame'; } else if (!is_null($this->procedimento_cirurgico_id)) { return 'procedimento_cirurgico'; } else if (!is_null($this->especialidade_id)) { return 'especialidade'; } } }