37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\DomainFluctuation\App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Modules\DomainFluctuation\App\DTOs\DomainFluctuationFilterDTO;
|
|
|
|
class IndexDomainFluctuationRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'term_id' => ['nullable', 'integer'],
|
|
'keyword' => ['nullable', 'string', 'max:255'],
|
|
'ownerType' => ['nullable', 'in:C,T'],
|
|
'status' => ['nullable', 'integer', 'in:0,1'],
|
|
'action' => ['nullable', 'string', 'max:100'],
|
|
'from' => ['nullable', 'integer'],
|
|
'to' => ['nullable', 'integer'],
|
|
'per_page' => ['nullable', 'integer', 'min:1', 'max:200'],
|
|
'page' => ['nullable', 'integer', 'min:1'],
|
|
'sort_by' => ['nullable', 'in:id,domainName,registeredDate,expiredDate,actionDate,created_at'],
|
|
'sort_dir' => ['nullable', 'in:asc,desc'],
|
|
];
|
|
}
|
|
|
|
public function toDTO(): DomainFluctuationFilterDTO
|
|
{
|
|
return DomainFluctuationFilterDTO::fromArray($this->validated());
|
|
}
|
|
}
|