Passed
Push — main ( 7d21ad...5ef848 )
by Seth
03:42
created

DynamicSettingIndexRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 3 1
A rules() 0 9 1
1
<?php
2
3
namespace SaasReady\Http\Requests\DynamicSetting;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
use SaasReady\Rules\ClassExistsRule;
7
8
class DynamicSettingIndexRequest extends FormRequest
9
{
10
    public function authorize(): bool
11
    {
12
        return true;
13
    }
14
15
    public function rules(): array
16
    {
17
        return [
18
            'limit' => 'required|int|max:100',
19
            'page' => 'required|int|min:1',
20
            'source_type' => [
21
                'nullable',
22
                'string',
23
                new ClassExistsRule(),
24
            ],
25
        ];
26
    }
27
}
28