Label multi-branch department picks and add searchable patients.
Deploy Ladill Care / deploy (push) Successful in 27s

Make appointment/practitioner department (and practitioner) options show branch names so duplicates are distinguishable, and replace the patient select with a searchable dropdown.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 17:31:32 +00:00
co-authored by Cursor
parent 5a1d47b9cc
commit 2ac84faf73
10 changed files with 304 additions and 14 deletions
+24
View File
@@ -64,6 +64,30 @@ class Practitioner extends Model
return $this->hasMany(Appointment::class, 'practitioner_id');
}
/**
* Select option label includes branch context when available.
*/
public function labelForSelect(): string
{
$branchNames = [];
if ($this->relationLoaded('branches') && $this->branches->isNotEmpty()) {
$branchNames = $this->branches->pluck('name')->filter()->values()->all();
} elseif ($this->relationLoaded('branch') && $this->branch?->name) {
$branchNames = [$this->branch->name];
} elseif ($this->branch_id) {
$name = $this->branch()?->value('name');
if ($name) {
$branchNames = [$name];
}
}
if ($branchNames === []) {
return (string) $this->name;
}
return $this->name.' — '.implode(', ', $branchNames);
}
/**
* @return list<int>
*/