mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
44 lines
894 B
PHP
44 lines
894 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Segments\Standards\Validators;
|
|
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Segments\DataTransferObjects\ConstantObject;
|
|
|
|
class ConstantValidation extends AbstractValidation
|
|
{
|
|
/**
|
|
* @param ConstantObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array {
|
|
|
|
$data = [
|
|
'name' => $object->getName(),
|
|
'reference' => $object->getReference(),
|
|
'detail' => $object->getDetail()
|
|
];
|
|
|
|
return $data;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function rules(): array {
|
|
return [
|
|
'name' => 'required',
|
|
'reference' => 'required',
|
|
'detail' => 'required'
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array {
|
|
return [];
|
|
}
|
|
|
|
} |