Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
9 / 9 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| UsageByPlanRequest | |
100.00% |
9 / 9 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| rules | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| messages | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Requests\v2\Admin\SystemDashboard; |
| 4 | |
| 5 | use App\Http\Requests\v2\Parameter\Concerns\AuthorizesVengresoAdmin; |
| 6 | use Illuminate\Foundation\Http\FormRequest; |
| 7 | |
| 8 | class UsageByPlanRequest extends FormRequest |
| 9 | { |
| 10 | use AuthorizesVengresoAdmin; |
| 11 | |
| 12 | public function rules(): array |
| 13 | { |
| 14 | return [ |
| 15 | 'period' => 'required|in:daily,weekly,monthly', |
| 16 | 'from' => 'sometimes|nullable|date_format:Y-m-d', |
| 17 | 'to' => 'sometimes|nullable|date_format:Y-m-d|after_or_equal:from', |
| 18 | ]; |
| 19 | } |
| 20 | |
| 21 | public function messages(): array |
| 22 | { |
| 23 | return [ |
| 24 | 'period.required' => 'The period field is required.', |
| 25 | 'period.in' => 'The period must be one of: daily, weekly, monthly.', |
| 26 | ]; |
| 27 | } |
| 28 | } |