'date', 'end_date' => 'date', 'coverage_amount' => 'decimal:2', ]; public function business() { return $this->belongsTo(Business::class); } public function equipment() { return $this->belongsTo(Equipment::class, 'equipment_id'); } public function customer() { return $this->belongsTo(Contact::class, 'customer_id'); } public function creator() { return $this->belongsTo(User::class, 'created_by'); } public function isActive(): bool { if ($this->status !== 'active') { return false; } $today = now()->startOfDay(); if ($this->start_date && $this->start_date->gt($today)) { return false; } if ($this->end_date && $this->end_date->lt($today)) { return false; } return true; } }