'required|max:255', 'type' => 'required|in:text,select,radio,checkbox', ]; } /** * Determine if the user is authorized to make this request. */ public function authorize(): bool { return true; } public function prepareValidationData($data){ if(!$this->type){ $this->merge(['type' => 'text']); } } }