Skip to content
Advertisement

how to limiting word on the laravel blade?

I’m looking to find out how to limit word in laravel blade. I’ve coded using substr, but it’s still not working properly. Can anyone help me?

JavaScript

Advertisement

Answer

The Str::words method limits the number of words in a string. An additional string may be passed to this method via its third argument to specify which string should be appended to the end of the truncated string:

JavaScript

you have to import

JavaScript

Ref:https://laravel.com/docs/8.x/helpers#method-str-words

you can avoid use import like below

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement