Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
StoreQuestionRequest
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 authorize
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 rules
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 attributes
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Http\Requests\Questions;
4
5use Illuminate\Foundation\Http\FormRequest;
6
7class StoreQuestionRequest extends FormRequest
8{
9    /**
10     * Determine if the user is authorized to make this request.
11     *
12     * @return boolean
13     */
14    public function authorize(): bool
15    {
16        return auth()->check();
17    }
18
19    /**
20     * Get the validation rules that apply to the request.
21     *
22     * @return array
23     */
24    public function rules(): array
25    {
26        return [
27            'question' => 'required|string|min:5|max:255',
28            'type' => 'required|integer|min:0',
29            'brand_id' => 'required|integer|min:0',
30        ];
31    }
32
33    /**
34     * Get custom attributes for validator errors.
35     *
36     * @return array
37     */
38    public function attributes(): array
39    {
40        return [
41            'question' => trans('Texte de la question'),
42            'type' => trans('Type de question'),
43            'brand_id' => trans('Id de la marque'),
44        ];
45    }
46}