'date', 'target_date' => 'date', 'current_progress_value' => 'decimal:2', 'target_value' => 'decimal:2', ]; public function user(): BelongsTo { return $this->belongsTo(User::class); } public function getProgressPercentageAttribute(): float { if ($this->target_value == 0) { return 0; } return min(100, ($this->current_progress_value / $this->target_value) * 100); } public function getIsCompletedAttribute(): bool { return $this->status === 'completed' || $this->current_progress_value >= $this->target_value; } }