⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
hospital.dev-unit.com
/
app
/
Models
/
View File Name :
OpdPrescriptionItem.php
<?php namespace App\Models; use App\Traits\PopulateTenantID; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Stancl\Tenancy\Database\Concerns\BelongsToTenant; /** * App\Models\OpdPrescriptionItem * * @property int $id * @property int $opd_prescription_id * @property int $category_id * @property int $medicine_id * @property string $dosage * @property int $dose_interval * @property int|null $day * @property int|null $time * @property string $instruction * @property string|null $tenant_id * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem newQuery() * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem query() * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereOpdPrescriptionId($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereCategoryId($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereMedicineId($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereDosage($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereDoseInterval($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereDay($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereTime($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereInstruction($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereTenantId($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|OpdPrescriptionItem whereUpdatedAt($value) * * @mixin \Eloquent * * @property-read Category $medicineCategory * @property-read Medicine $medicine */ class OpdPrescriptionItem extends Model { use BelongsToTenant, PopulateTenantID; public $table = 'opd_prescription_items'; public $fillable = [ 'opd_prescription_id', 'category_id', 'medicine_id', 'dosage', 'instruction', 'dose_interval', 'day', 'time', ]; /** * Validation rules * * @var array */ public static $rules = [ 'category_id' => 'required', ]; /** * Get the attributes that should be cast. * * @return array<string, string> */ protected function casts(): array { return [ 'id' => 'integer', 'opd_prescription_id' => 'integer', 'category_id' => 'integer', 'medicine_id' => 'integer', 'dosage' => 'string', 'instruction' => 'string', 'dose_interval' => 'integer', 'day' => 'integer', 'time' => 'integer', ]; } public function medicineCategory(): BelongsTo { return $this->belongsTo(Category::class, 'category_id'); } public function medicine(): BelongsTo { return $this->belongsTo(Medicine::class, 'medicine_id'); } public function prescriptionMedicines(): BelongsTo { return $this->belongsTo(PrescriptionMedicineModal::class, 'opd_prescription_id'); } }