osb/app/Models/Service/Host.php
Deon George 67824d4ab5
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 32s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s
Remove binary attributes from DB, should be json columns
2024-07-07 19:10:00 +10:00

51 lines
945 B
PHP

<?php
namespace App\Models\Service;
use App\Casts\CollectionOrNull;
use App\Models\SupplierHostServer;
use App\Traits\ServiceDomains;
/**
* Class Host (Service)
* Services that are Web Hosting
*/
class Host extends Type
{
use ServiceDomains;
protected $casts = [
'server_data' => CollectionOrNull::class,
];
protected $table = 'service_host';
protected $with = [
'tld',
];
/* RELATIONS */
public function provider()
{
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',
];
}
}