|string> */ public function rules(): array { return [ 'stat' => ['required', 'string', 'in:strength,defense,speed,dexterity'], ]; } /** * Get custom messages for validator errors. * * @return array */ public function messages(): array { return [ 'stat.required' => 'You must select a stat to train.', 'stat.string' => 'The stat must be a string.', 'stat.in' => 'The selected stat is invalid. Valid stats are: strength, defense, speed, dexterity.', ]; } }