Mail routing parent/children, domain name validation, nodelist import changes and other fixes

This commit is contained in:
Deon George
2021-07-26 21:21:58 +10:00
parent 49bc946024
commit b179b1b3e9
15 changed files with 537 additions and 171 deletions

View File

@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
use App\Http\Controllers\DomainController;
use App\Traits\ScopeActive;
use Illuminate\Support\Collection;
class System extends Model
{
@@ -61,12 +62,12 @@ class System extends Model
/**
* Return the system's address in the same zone
*
* @param Address $o
* @return Address
* @param Zone $o
* @return Collection
*/
public function match(Address $o): Address
public function match(Zone $o): Collection
{
return $this->addresses->where('zone_id',$o->zone_id)->first();
return $this->addresses->where('zone_id',$o->id);
}
/**
@@ -85,6 +86,8 @@ class System extends Model
return sprintf('RC-%s-%05d',$o->zone->domain->name,$o->region_id);
case DomainController::NODE_NC;
return sprintf('NC-%s-%05d',$o->zone->domain->name,$o->host_id);
case DomainController::NODE_HC;
case NULL:
default: