check(); } /** * Prepare the data for validation. */ protected function prepareForValidation(): void { $this->merge([ 'direction' => $this->route('direction') === 'up', ]); } /** * Get the validation rules that apply to the request. */ public function rules(): array { return [ 'direction' => 'required|boolean', ]; } }