Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
ImportShortcutRequest | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
authorize | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
rules | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Http\Requests; |
4 | |
5 | use Illuminate\Foundation\Http\FormRequest; |
6 | use Illuminate\Validation\Rule; |
7 | |
8 | class ImportShortcutRequest extends FormRequest |
9 | { |
10 | /** |
11 | * Determine if the user is authorized to make this request. |
12 | */ |
13 | public function authorize(): bool |
14 | { |
15 | return true; |
16 | } |
17 | |
18 | /** |
19 | * Get the validation rules that apply to the request. |
20 | */ |
21 | public function rules(): array |
22 | { |
23 | return [ |
24 | '*.title' => 'string', |
25 | '*.shortcut' => Rule::unique('shortcuts', 'shortcut')->where('user_id', $this->user()->id), |
26 | '*.text' => 'required|string', |
27 | '*.html' => 'required|string', |
28 | '*.category' => 'string', |
29 | '*.uploads' => 'sometimes|array', |
30 | ]; |
31 | } |
32 | } |