mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-20 04:53:59 +00:00
45 lines
983 B
PHP
45 lines
983 B
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 [
|
|
'company_id' => $object->getCompanyId(),
|
|
'name' => $object->getName(),
|
|
'designation' => $object->getDesignation(),
|
|
'email' => $object->getEmail(),
|
|
'phone' => $object->getPhone(),
|
|
'wechat_id' => $object->getWechatId()
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function rules(): array {
|
|
return [
|
|
'company_id' => 'required',
|
|
'name' => 'required'
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array {
|
|
return [];
|
|
}
|
|
|
|
} |