Updates to service updating - broadband
This commit is contained in:
@@ -10,6 +10,7 @@ use App\Interfaces\ServiceUsage;
|
||||
use App\Models\Supplier\Broadband as SupplierBroadband;
|
||||
use App\Models\Supplier\Type as SupplierType;
|
||||
use App\Models\Usage\Broadband as UsageBroadband;
|
||||
use App\Rules\IPv6_CIDR;
|
||||
|
||||
/**
|
||||
* Class Broadband (Service)
|
||||
@@ -81,6 +82,27 @@ class Broadband extends Type implements ServiceUsage
|
||||
return $value ?: $this->supplied()->technology;
|
||||
}
|
||||
|
||||
/* OVERRIDES */
|
||||
|
||||
/**
|
||||
* Service update validation
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function validation(): array
|
||||
{
|
||||
return [
|
||||
'service_number' => 'nullable|string|min:10|max:10',
|
||||
'service_username' => 'nullable|string',
|
||||
'service_password' => 'nullable|string',
|
||||
'connect_at' => 'nullable|date',
|
||||
'start_at' => 'nullable|date',
|
||||
'expire_at' => 'nullable|date|after:start_at',
|
||||
'ipaddress' => 'nullable|ipv4',
|
||||
'ip6address' => ['nullable',new IPv6_CIDR],
|
||||
];
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
||||
/**
|
||||
|
@@ -69,13 +69,23 @@ abstract class Type extends Model implements ServiceItem
|
||||
* @param $value
|
||||
* @return LeenooksCarbon
|
||||
*/
|
||||
public function getExpireAtAttribute($value): LeenooksCarbon
|
||||
public function getExpireAtAttribute($value): ?LeenooksCarbon
|
||||
{
|
||||
return LeenooksCarbon::create($value);
|
||||
return $value ? LeenooksCarbon::create($value) : NULL;
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
||||
/**
|
||||
* Validation used to accept form input
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function validation(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* The supplier's service that we provide
|
||||
*
|
||||
|
Reference in New Issue
Block a user