Home > Software design >  How to do "read more or read less" concept for tinymce Editor content in Laravel blade fil
How to do "read more or read less" concept for tinymce Editor content in Laravel blade fil

Time:06-18

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 >>>') !!}

  • Related