-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrescriptionMedicineModal.php
60 lines (50 loc) · 1.25 KB
/
PrescriptionMedicineModal.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace App\Models;
use Eloquent as Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* Class PrescriptionMedicineModal
*
* @version July 30, 2022, 6:29 pm UTC
*
* @property string $medicine
* @property string $dosage
* @property string $day
* @property string $time
* @property string $comment
*/
class PrescriptionMedicineModal extends Model
{
use HasFactory;
public $table = 'prescriptions_medicines';
public $fillable = [
'prescription_id',
'medicine',
'dosage',
'day',
'time',
'dose_interval',
'comment',
];
protected $casts = [
'prescription_id' => 'string',
'medicine' => 'string',
'dosage' => 'string',
'day' => 'string',
'time' => 'string',
'dose_interval' => 'string',
'comment' => 'string',
];
public static $rules = [
];
public function prescription(): BelongsTo
{
return $this->belongsTo(Prescription::class, 'prescription_id');
}
public function medicines(): HasMany
{
return $this->hasMany(Medicine::class, 'id', 'medicine');
}
}