Rework address roles, making Address::role optional, rework determining uplink/downlinks/parent/children

This commit is contained in:
2024-05-09 21:22:30 +10:00
parent 2765a27db8
commit 23159d19d5
23 changed files with 667 additions and 421 deletions

View File

@@ -117,7 +117,7 @@ function our_address(Domain|Address $o=NULL): Collection|Address|NULL
$filter = $our->filter(function($item) use ($o) { return $item->zone->domain_id === $o->zone->domain_id; })->sortBy('role');
// If we are looking for a specific address, and there is only 1 result, return it, otherwise return what we have
if (config('fido.strict') && ($x=$filter->filter(function($item) use ($o) { return $item->role <= $o->role; })->sortBy('role'))->count())
if (config('fido.strict') && ($x=$filter->filter(function($item) use ($o) { return $item->role_id <= $o->role_id; })->sortBy('role'))->count())
$filter = $x;
return $filter->last();