forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaseListRequest.php
More file actions
35 lines (31 loc) · 934 Bytes
/
CaseListRequest.php
File metadata and controls
35 lines (31 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace ProcessMaker\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use ProcessMaker\Rules\SortBy;
class CaseListRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'userId' => 'sometimes|integer',
'status' => 'sometimes|in:IN_PROGRESS,COMPLETED',
'sortBy' => ['sometimes', 'string', new SortBy],
'filterBy' => 'sometimes|json',
'search' => 'sometimes|string',
'pageSize' => 'sometimes|integer|min:1',
'page' => 'sometimes|integer|min:1',
];
}
}