Label multi-branch department picks and add searchable patients.
Deploy Ladill Care / deploy (push) Successful in 27s
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:
@@ -26,4 +26,20 @@ class Department extends Model
|
||||
{
|
||||
return $this->belongsTo(Branch::class, 'branch_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Select option label — includes branch when set so multi-branch duplicates are distinguishable.
|
||||
*/
|
||||
public function labelForSelect(): string
|
||||
{
|
||||
$branch = $this->relationLoaded('branch')
|
||||
? $this->branch
|
||||
: $this->branch()->first();
|
||||
|
||||
if ($branch?->name) {
|
||||
return $this->name.' — '.$branch->name;
|
||||
}
|
||||
|
||||
return (string) $this->name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user