Allow explicit multi-branch practitioner assignment for telemedicine.
Deploy Ladill Care / deploy (push) Successful in 1m29s

Replace optional “All branches” with required branch checkboxes; doctors may switch only among assigned sites, never org-wide by default.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 08:50:03 +00:00
co-authored by Cursor
parent d643687335
commit 899b08179e
17 changed files with 478 additions and 103 deletions
@@ -58,12 +58,20 @@ trait ScopesToAccount
protected function scopeToBranch(Request $request, Builder $query, string $column = 'branch_id'): Builder
{
$branchId = app(OrganizationResolver::class)->branchScope($this->member($request));
$allowed = app(OrganizationResolver::class)->allowedBranchIds($this->member($request));
if ($branchId !== null) {
$query->where($column, $branchId);
if ($allowed !== null) {
$query->whereIn($column, $allowed !== [] ? $allowed : [0]);
}
return $query;
}
protected function authorizeBranch(Request $request, ?int $branchId): void
{
abort_unless(
app(OrganizationResolver::class)->mayAccessBranch($this->member($request), $branchId),
404,
);
}
}