'date', 'received_at' => 'datetime', ]; } public function drug(): BelongsTo { return $this->belongsTo(Drug::class, 'drug_id'); } public function dispensingRecords(): HasMany { return $this->hasMany(DispensingRecord::class, 'drug_batch_id'); } public function isExpired(): bool { return $this->expiry_date !== null && $this->expiry_date->isPast(); } }