route('general_setting')); } /** * Prepare the data for validation. * * @return void */ public function prepareForValidation(): void { $this->merge([ 'value' => json_decode($this->input('jsonValue', '[]')) ]); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'jsonValue' => 'required|json', 'value' => 'required' ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'value' => trans('validation.custom.value') ]; } }