check(); } /** * Prepare the data for validation. */ public function prepareForValidation(): void { $this->merge([ 'completed_at' => $this->completed_at ? strtotime(Carbon::parse('now')) : null, ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'title' => 'nullable|string|max:255', 'description' => 'nullable|string|max:255', 'due_start' => 'nullable|date', 'due_end' => 'nullable|date|after_or_equal:due_start', 'completed_at' => 'nullable', ]; } }