Files
ladill-queue/app/Services/Qms/PlanService.php
T
isaaccladandCursor cca98eefd2
Deploy Ladill Queue / deploy (push) Successful in 56s
Initial Ladill Queue release — enterprise QMS standalone app.
Phases 1–6: tickets, counters, displays, appointments, workflows, rules, analytics, reports, feedback, admin, device API, and Gitea deploy workflow for queue.ladill.com.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 20:19:52 +00:00

43 lines
1.1 KiB
PHP

<?php
namespace App\Services\Qms;
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
{
return config('qms.plans.'.$this->plan($organization).'.max_branches');
}
public function maxQueues(Organization $organization): ?int
{
return config('qms.plans.'.$this->plan($organization).'.max_queues');
}
public function canAddBranch(Organization $organization, int $currentCount): bool
{
$max = $this->maxBranches($organization);
return $max === null || $currentCount < $max;
}
public function canAddQueue(Organization $organization, int $currentCount): bool
{
$max = $this->maxQueues($organization);
return $max === null || $currentCount < $max;
}
}