Non Stop Status
Non Stop Status

Reputation: 1

How to show limited text and remove html tags in Larave blade?

I am new to laravel. I am using {{ Str::limit($leave->leave_reasone, 50) }} to show limited Text And {!! $leave->leave_reasone !!} to remove Html Tags. But How can I apply Both in laravel blade?

Upvotes: 0

Views: 799

Answers (1)

zahid hasan emon
zahid hasan emon

Reputation: 6233

you can use limit inside {!! !!}. both {{ }} and {!! !}} print variables inside them. the difference is {{ }} uses PHP's htmlspecialchars function to prevent XSS attacks while {!! !}} is used to print unescaped data.

{!! Str::limit($leave->leave_reasone, 50) !!}

Upvotes: 0

Related Questions