Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
9 / 9 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| GenerateICPRolePlayProjectRequest | |
100.00% |
9 / 9 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| authorize | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| rules | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Requests\v2\RolePlay; |
| 4 | |
| 5 | use App\Http\Models\RolePlayProjects; |
| 6 | use Illuminate\Foundation\Http\FormRequest; |
| 7 | use Illuminate\Validation\Rule; |
| 8 | |
| 9 | class GenerateICPRolePlayProjectRequest extends FormRequest |
| 10 | { |
| 11 | /** |
| 12 | * Determine if the user is authorized to make this request. |
| 13 | * |
| 14 | * @return bool |
| 15 | */ |
| 16 | public function authorize(): bool |
| 17 | { |
| 18 | return true; |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Get the validation rules that apply to the request. |
| 23 | * |
| 24 | * @return array |
| 25 | */ |
| 26 | public function rules(): array |
| 27 | { |
| 28 | return [ |
| 29 | 'type' => ['required', 'string', Rule::in([RolePlayProjects::$COLD_CALL, RolePlayProjects::$DISCOVERY_CALL])], |
| 30 | 'industry' => ['required', 'string'], |
| 31 | 'product_description' => ['required', 'string'], |
| 32 | 'key_features' => 'nullable|array', |
| 33 | 'key_features.*' => 'string|max:255', |
| 34 | 'difficulty_level' => 'required|numeric|in:1,2,3,4,5' |
| 35 | ]; |
| 36 | } |
| 37 | } |