Added Supplier Domain importing - using dreamscape API

This commit is contained in:
Deon George
2022-08-10 15:18:56 +10:00
parent 53c665787e
commit e4c1305da5
8 changed files with 268 additions and 45 deletions

View File

@@ -2,6 +2,8 @@
namespace App\Models\Supplier;
use Illuminate\Support\Collection;
use App\Interfaces\SupplierItem;
use App\Models\Product\Domain as ProductDomain;
use App\Models\TLD;
@@ -29,6 +31,22 @@ final class Domain extends Type implements SupplierItem
return $this->hasMany(ProductDomain::class,'supplier_item_id','id');
}
/* STATIC */
/**
* Determine the owner of the name servers used for the domain
*
*/
public static function nameserver_name(Collection $nameservers): string
{
foreach (config('nameservers') as $key => $ns) {
if ($nameservers->diff($ns)->count() < count($ns))
return $key;
}
return 'custom';
}
/* RELATIONS */
public function tld()