Fix empty demo lab catalog for admins.
Deploy Ladill Care / deploy (push) Successful in 2m7s

Seed investigation types early (before clinical data), expand the default catalog, scope Lab → Catalog by organization, and harden practitioner-branch sync so a mid-reseed failure cannot wipe the catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 09:06:35 +00:00
co-authored by Cursor
parent 899b08179e
commit f87f216fb4
5 changed files with 73 additions and 13 deletions
+7
View File
@@ -85,6 +85,13 @@ class Practitioner extends Model
*/
public function syncAssignedBranches(array $branchIds): void
{
if (! \Illuminate\Support\Facades\Schema::hasTable('care_practitioner_branch')) {
$ids = array_values(array_unique(array_filter(array_map('intval', $branchIds))));
$this->forceFill(['branch_id' => $ids[0] ?? null])->save();
return;
}
$ids = array_values(array_unique(array_filter(array_map('intval', $branchIds))));
$this->branches()->sync($ids);
$this->forceFill([