nanosanteservice/app/Models/NhInfosHealthCareSheets.php

49 lines
1.1 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class NhInfosHealthCareSheets extends Model
{
protected $table = 'nh_infos_health_care_sheets';
// protected $dates = [
// 'start_at',
// 'end_at'
// ];
public function network()
{
return $this->belongsTo(Network::class, 'network_id');
}
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
public function performances()
{
return $this->hasManyThrough(NhPerformance::class, NhHealthCareSheetsPerformance::class,
'sheet_id', 'id', 'id', 'performance_id');
}
public function exams()
{
return $this->hasManyThrough(NhExam::class, NhHealthCareSheetsExam::class,
'sheet_id', 'id', 'id', 'exam_id');
}
public function prescriptions()
{
return $this->hasManyThrough(NhMedicalPrescription::class, NhHealthCareSheetsPrescription::class,
'sheet_id', 'id', 'id', 'prescription_id');
}
}