Simple problems require simple solutions
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
677 B

<?php
namespace App\Http\Requests;
use App\Enums\DurationModifier;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Enum;
class CalculateDurationRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'start.date' => ['required', 'date_format:Y-m-d'],
'start.timezone' => ['nullable', 'timezone:all'],
'end.date' => ['required', 'date_format:Y-m-d'],
'end.timezone' => ['nullable', 'timezone:all'],
'convert_to' => ['nullable', new Enum(DurationModifier::class)],
];
}
}