2019-06-07 06:54:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Service;
|
|
|
|
|
2022-08-02 09:16:52 +00:00
|
|
|
use App\Models\SupplierHostServer;
|
2022-04-22 01:47:46 +00:00
|
|
|
use App\Traits\ServiceDomains;
|
2019-06-13 04:32:34 +00:00
|
|
|
|
2022-04-19 07:07:39 +00:00
|
|
|
/**
|
|
|
|
* Class Host (Service)
|
|
|
|
* Services that are Web Hosting
|
|
|
|
*/
|
2022-04-22 01:47:46 +00:00
|
|
|
class Host extends Type
|
2019-06-07 06:54:27 +00:00
|
|
|
{
|
2022-04-19 07:07:39 +00:00
|
|
|
use ServiceDomains;
|
|
|
|
|
|
|
|
protected $table = 'service_host';
|
|
|
|
protected $with = ['tld'];
|
2019-06-13 04:32:34 +00:00
|
|
|
|
2022-04-19 07:07:39 +00:00
|
|
|
/* RELATIONS */
|
2019-06-07 06:54:27 +00:00
|
|
|
|
2020-02-20 11:54:28 +00:00
|
|
|
public function provider()
|
2019-06-07 06:54:27 +00:00
|
|
|
{
|
2022-08-02 09:16:52 +00:00
|
|
|
return $this->belongsTo(SupplierHostServer::class,'supplier_host_server_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
/* OVERRIDES */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Service update validation
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function validation(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'domain_name' => 'nullable|string|min:2',
|
|
|
|
'tld_id' => 'required|exists:tlds,id',
|
|
|
|
'expire_at' => 'required|date',
|
|
|
|
'supplier_host_server_id' => 'required|exists:supplier_host_servers,id',
|
|
|
|
'host_username' => 'nullable|string',
|
|
|
|
'host_password' => 'nullable|string',
|
|
|
|
];
|
2020-02-20 11:54:28 +00:00
|
|
|
}
|
2019-06-07 06:54:27 +00:00
|
|
|
}
|