mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-27 08:24:39 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Addresses\Standards\Validators;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractValidation;
|
||||
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
|
||||
|
||||
class AddressValidation extends AbstractValidation
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param AddressObject $object
|
||||
* @return array
|
||||
*/
|
||||
protected function data($object): array {
|
||||
return [
|
||||
'company_id' => $object->getCompanyId(),
|
||||
'street_one' => $object->getStreetOne(),
|
||||
'street_two' => $object->getStreetTwo(),
|
||||
'city' => $object->getCity(),
|
||||
'state' => $object->getState(),
|
||||
'post_code' => $object->getPostCode(),
|
||||
'country' => $object->getCountry(),
|
||||
'default' => $object->getDefault(),
|
||||
'billing' => $object->getBilling()
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function rules(): array {
|
||||
return [
|
||||
'company_id' => 'required',
|
||||
'street_one' => 'required',
|
||||
'city' => 'required',
|
||||
'state' => 'required',
|
||||
'post_code' => 'required',
|
||||
'country' => 'required',
|
||||
'default' => 'required',
|
||||
'billing' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function messages(): array {
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user