File: /var/www/vhost/disk-apps/dev-telemedicina.teky.com.co/app/HeaderValue.php
<?php
namespace Telemedicina;
use Telemedicina\Event;
use Telemedicina\DocumentState;
use Illuminate\Database\Eloquent\Model;
class HeaderValue extends Model
{
public function header_value_details(){
return $this->hasMany(HeaderValueDetail::class, 'header_value_id', 'id')->with('field');
}
public function clinic_document(){
return $this->belongsTo(ClinicDocument::class, 'clinic_document_id', 'id');
}
public function user(){
return $this->belongsTo(User::class, 'user_id', 'id')->with('city');
}
public function form(){
return $this->belongsTo(Form::class)->with('specialty');
}
public function events(){
return $this->hasMany(Event::class, 'header_value_id', 'id')->with('agenda_type');
}
public function medic(){
return $this->belongsTo(User::class, 'suggested_medic_id', 'id');
}
public function agenda_types(){
return $this->belongsTo(AgendaType::class, 'date_type_id');
}
public function state(){
return $this->belongsTo(DocumentState::class, 'state');
}
}