Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 14 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| ReportingFormRequest | |
0.00% |
0 / 14 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| authorize | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| rules | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Requests; |
| 4 | |
| 5 | use App\Http\Models\Auth\Role; |
| 6 | use Illuminate\Foundation\Http\FormRequest; |
| 7 | |
| 8 | class ReportingFormRequest 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 | * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> |
| 22 | */ |
| 23 | public function rules(): array |
| 24 | { |
| 25 | return [ |
| 26 | 'month_period' => 'required_without_all:from_date,to_date|in:1,3,6,12', |
| 27 | 'from_date' => 'sometimes|date', |
| 28 | 'to_date' => 'required_with:fromDate|date', |
| 29 | 'companies' => 'sometimes|nullable|array', |
| 30 | 'companies.*' => 'string|exists:companies,_id', |
| 31 | 'groups' => 'sometimes|nullable|array', |
| 32 | 'groups.*' => 'string|exists:company_groups,_id', |
| 33 | 'subgroups' => 'sometimes|nullable|array', |
| 34 | 'subgroups.*' => 'string|exists:company_groups,_id', |
| 35 | 'users' => 'sometimes|nullable|array', |
| 36 | 'users.*' => 'string|exists:users,_id', |
| 37 | ]; |
| 38 | } |
| 39 | } |