mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
42 lines
864 B
PHP
42 lines
864 B
PHP
<?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 [
|
|
'street_one' => $object->getStreetOne(),
|
|
'street_two' => $object->getStreetTwo(),
|
|
'district_id' => $object->getDistrictId()
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function rules(): array {
|
|
return [
|
|
'street_one' => 'required',
|
|
'district_id' => 'required',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array {
|
|
return [];
|
|
}
|
|
|
|
} |