mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-27 08:24:39 +00:00
52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Packages\Standards\Validators;
|
|
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Packages\DataTransferObjects\PackageObject;
|
|
|
|
class PackageValidation extends AbstractValidation
|
|
{
|
|
|
|
|
|
/**
|
|
* @param PackageObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array {
|
|
return [
|
|
'order_id' => $object->getOrderId(),
|
|
'type' => $object->getType(),
|
|
'width' => $object->getWidth(),
|
|
'height' => $object->getHeight(),
|
|
'length' => $object->getLength(),
|
|
'weight' => $object->getWeight(),
|
|
'quantity' => $object->getQuantity(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function rules(): array {
|
|
return [
|
|
'order_id' => 'required',
|
|
'type' => 'required',
|
|
'width' => 'required',
|
|
'height' => 'required',
|
|
'length' => 'required',
|
|
'weight' => 'required',
|
|
'quantity' => 'required',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array {
|
|
return [];
|
|
}
|
|
|
|
}
|