|string> */ public function rules(): array { return [ 'vineyard_row_id' => ['required', 'exists:vineyard_rows,id'], 'variety_variation_id' => ['required', 'exists:variety_variations,id'], 'weight' => ['required', 'numeric', 'min:0', 'max:99999.99'], 'sugar_content' => ['nullable', 'numeric', 'min:0', 'max:50'], 'date' => ['required', 'date', 'before_or_equal:today'], 'quality' => ['nullable', 'in:excellent,good,fair,poor'], 'grape_condition' => ['nullable', 'string', 'max:255'], 'notes' => ['nullable', 'string', 'max:1000'], 'weather_conditions' => ['nullable', 'string', 'max:500'], 'harvest_time' => ['nullable', 'date_format:H:i'], ]; } /** * Get custom messages for validator errors. * * @return array */ public function messages(): array { return [ 'date.before_or_equal' => 'The harvest date cannot be in the future.', 'harvest_time.date_format' => 'The harvest time must be in HH:MM format.', ]; } /** * Get custom attribute names for validator errors. * * @return array */ public function attributes(): array { return [ 'vineyard_row_id' => 'vineyard row', 'variety_variation_id' => 'variety variation', 'sugar_content' => 'sugar content (°NM)', 'harvest_time' => 'harvest time', ]; } }