composer require lawrence72/sanitizer
$sanitizer = new Sanitizer();
$text = "Some Text"
$new_text = $sanitizer->clean($text);
Include the tags you wish to allow
$sanitizer = new Sanitizer();
$text = "
Some Text
"
$new_text = $sanitizer->clean($text,['div']);