'decimal:2', 'spent_monthly' => 'decimal:2', 'revenue' => 'decimal:2', 'is_active' => 'boolean', ]; public function getRoiAttribute(): float { $spent = (float) $this->spent_monthly; if ($spent <= 0) { return 0; } return round((((float) $this->revenue - $spent) / $spent) * 100, 2); } public function getConversionRateAttribute(): float { $leads = (int) $this->leads_count; if ($leads <= 0) { return 0; } return round(((int) $this->converted_count / $leads) * 100, 2); } public function getCostPerLeadAttribute(): float { $leads = (int) $this->leads_count; if ($leads <= 0) { return 0; } return round((float) $this->spent_monthly / $leads, 2); } }