mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
44 lines
1017 B
PHP
44 lines
1017 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Announcements\Standards\Validators;
|
|
|
|
use App\Classes\General\Abstracts\AbstractValidation;
|
|
use App\Classes\Modules\Announcements\DataTransferObjects\AnnouncementObject;
|
|
|
|
class AnnouncementValidation extends AbstractValidation
|
|
{
|
|
/**
|
|
* @param AnnouncementObject $object
|
|
* @return array
|
|
*/
|
|
protected function data($object): array
|
|
{
|
|
return [
|
|
'title' => $object->getTitle(),
|
|
'description' => $object->getDescription(),
|
|
'starting_on' => $object->getStartingOn(),
|
|
'ending_on' => $object->getEndingOn()
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function rules(): array
|
|
{
|
|
return [
|
|
'title' => 'required',
|
|
'description' => 'required',
|
|
'starting_on' => 'required',
|
|
'ending_on' => 'required'
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function messages(): array
|
|
{
|
|
return [];
|
|
}
|
|
} |