route('screening')->user_id === auth()->id(); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'answers' => ['required', 'array', 'size:10'], 'answers.*' => ['required', 'string', 'in:yes,no'], ]; } /** * Custom validation messages. */ public function messages(): array { return [ 'answers.required' => 'All screening questions must be answered.', 'answers.array' => 'Answers must be provided as an array.', 'answers.size' => 'All 10 screening questions must be answered.', 'answers.*.required' => 'Each screening question must have an answer.', 'answers.*.string' => 'Each answer must be a valid text value.', 'answers.*.in' => 'Each answer must be either "yes" or "no".', ]; } }