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

@@ -101,9 +101,8 @@ class User extends Authenticatable implements MustVerifyEmail
}
/**
* Return the zones that this user is ZC for
*
* @return Collection
* @deprecated not used - but if it is, probably could use Address::points()?
*/
public function points(): Collection
{
@@ -122,8 +121,8 @@ class User extends Authenticatable implements MustVerifyEmail
*/
public function zc(): Collection
{
$this->load('systems.addresses');
$this->load('systems.addresses.nodes_hub');
return $this->systems->pluck('addresses')->flatten()->where('role',Address::NODE_ZC);
return $this->systems->pluck('addresses')->flatten()->where('role_id',Address::NODE_ZC);
}
}