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
@@ -13,15 +13,27 @@
<label class="block text-sm font-medium">Specialty (optional)</label>
<input type="text" name="specialty" value="{{ old('specialty', $practitioner->specialty) }}" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
</div>
<div>
<label class="block text-sm font-medium">Branch (optional)</label>
<select name="branch_id" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
<option value="">All branches</option>
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected(old('branch_id', $practitioner->branch_id) == $branch->id)>{{ $branch->name }}</option>
@endforeach
</select>
</div>
<fieldset>
<legend class="block text-sm font-medium">Branches</legend>
<p class="mt-1 text-xs text-slate-500">Select every site this clinician may serve (including telemedicine). Nothing is selected by default.</p>
@php
$selectedBranchIds = collect(old('branch_ids', $practitioner->assignedBranchIds()));
@endphp
<div class="mt-2 space-y-2 rounded-lg border border-slate-200 p-3">
@forelse ($branches as $branch)
<label class="flex items-center gap-2 text-sm text-slate-700">
<input type="checkbox" name="branch_ids[]" value="{{ $branch->id }}"
@checked($selectedBranchIds->contains($branch->id))
class="rounded border-slate-300 text-sky-600">
{{ $branch->name }}
</label>
@empty
<p class="text-sm text-slate-500">Create a branch first under Settings Branches.</p>
@endforelse
</div>
@error('branch_ids')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
@error('branch_ids.*')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
</fieldset>
<div>
<label class="block text-sm font-medium">Department (optional)</label>
<select name="department_id" class="mt-1 w-full rounded-lg border-slate-300 text-sm">