What validation rules should I have for a WYSIWYG editor input?
Hello,
I started using TinyMCE and currently the only validation rule I have is string (and min/max).
But is it correct? Are there any more important validation rules I need to add to the input?
From what I've seen, the <script> tags are already stripped
In terms of rules I think what your are doing it's ok. If you want to implement more logic around this you can use the HTML Purifier package (ezyang/htmlpurifier) or other similar to eliminate any potential XSS attacks.
This is an example of one of my implementations
$request->validate([
'editorContent' => [
'required',
'string',
'max:3000', // Adjust the value to suit your requirement
],
]);