require_checkinout_notes == '1') { $rules['notes'] = 'required|string|nullable'; } return $rules; } public function response(array $errors) { return $this->redirector->back()->withInput()->withErrors($errors, $this->errorBag); } }