> */ public function rules(): array { return [ 'received_at' => ['required', 'date'], 'received_quantity' => ['required', 'numeric', 'min:0.000001'], 'batch_number' => ['nullable', 'string', 'max:100'], 'best_before' => ['nullable', 'date'], 'quality_id' => ['nullable', 'integer', 'exists:material_qualities,id'], ]; } protected function prepareForValidation(): void { $this->merge([ 'received_quantity' => reFormatNumber($this->input('received_quantity')), ]); } }