Laravel cms: description display not working

  Fri 24 / 11 / 2023

  Posted by: Wisdom Omote

Category : Laravel

Tags : laravel , php , php laravel , backend

Post Thumbnail
Description

When ever i use {!! Str::limit($post->description, 15) !!} it display nothing in the output but if i did not use that it will diplay html character in my output


View Code
                        <td> {!! Str::limit($post->description, 15) !!}</td>
                
  Answered by CDL

I understand your issue, so the problem is str limit, where you told that I want to display 15 characters, so when ever you save description in the database with styling, so HTML attribute and style contain 15 character that's it's not displaying the contain.


Let's suppose you have added the below line.

<h1><span style="margin-top: 10px; padding-top:40px; text-color:white" >Your text here</span</h1>


So now your above HTML and CSS <h1><span style contains 15 characters so how this will display the text?


Solution:

You can increase your limit to 50 or still facing issues make it 100 to test it properly.


Exact Syntax:

<td> {!! Str::limit($post->description, 50) !!}</td>



  Comment   Share
1 Like   0 Comments