'datetime', 'expiry_date' => 'datetime', ]; public function user(): BelongsTo { return $this->belongsTo(User::class); } public function exam(): BelongsTo { return $this->belongsTo(Exam::class); } public function isActive(): bool { return $this->enrollment_type === 'lifetime' || ($this->expiry_date && now()->lt($this->expiry_date)); } }