Tuesday, 3 January 2017

How to truncate string in blade template in Laravel

To truncate the string in blade template use the following method inside the view template:

{{ str_limit($string, $limit = 256, $end = '...') }}

This method works with Laravel 4 and 5. 

for more helper functions please checkout the link 

https://laravel.com/docs/5.3/helpers#strings