Files
ladill-care/app/Services/Care/PlanService.php
T
isaaccladandCursor cd415e918f
Deploy Ladill Care / deploy (push) Successful in 40s
Raise Care Pro to GHS 199/mo.
Update plan config and billing service defaults to match suite pricing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 00:32:53 +00:00

38 lines
879 B
PHP

<?php
namespace App\Services\Care;
use App\Models\Organization;
class PlanService
{
public function plan(Organization $organization): string
{
return (string) data_get($organization->settings, 'plan', 'free');
}
public function isPro(Organization $organization): bool
{
return $this->plan($organization) === 'pro';
}
public function maxBranches(Organization $organization): ?int
{
$plan = config('care.plans.'.$this->plan($organization));
return $plan['max_branches'] ?? null;
}
public function canAddBranch(Organization $organization, int $currentCount): bool
{
$max = $this->maxBranches($organization);
return $max === null || $currentCount < $max;
}
public function proPriceMinor(): int
{
return (int) config('care.plans.pro.price_minor', 19900);
}
}