mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Contacts\Standards\Validators;
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
|
|
|
|
class ContactValidation extends AbstractValidation
|
|
{
|
|
/**
|
|
* @param ContactObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array
|
|
{
|
|
return [
|
|
'country_id' => $object->getCountryId(),
|
|
'company_id' => $object->getCompanyId(),
|
|
'contact_reference' => $object->getReference(),
|
|
'phone' => $object->getPhone(),
|
|
'contact_email' => $object->getEmail(),
|
|
'wechat_id' => $object->getWechatId()
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function rules(): array
|
|
{
|
|
return [
|
|
'country_id' => 'required',
|
|
'company_id' => 'required',
|
|
'contact_reference' => 'required',
|
|
'phone' => 'required',
|
|
'contact_email' => '',
|
|
'wechat_id' => ''
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array
|
|
{
|
|
return [];
|
|
}
|
|
} |