i am using a tinymce editor for inserting content into the database which stores the data along with the html tags and i want to add read more or read less concept to Laravel blade file. is any methods or technique is there in Laravel 8.
I have tried {!! Str::words($value->blog_content, 8, ' readmore >>>') !!}
but it doesn't consider the html tags, so UI was collapsed.
CodePudding user response:
You can strip the tags before call the words function
{!! Str::words(strip_tags($value->blog_content), 8, ' readmore >>>') !!}