Added Supplier Domain importing - using dreamscape API
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user