Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined function str_limit()

Tags:

php

laravel

Call to undefined function str_limit() laravel 6x this my code , help me

<dt>Description</dt>
<dd style="word-break: break-all;"> {{ str_limit($product ?? '',500,' ...') }}</dd>
like image 698
Masalief Maulana Avatar asked Jan 08 '20 07:01

Masalief Maulana


3 Answers

In version 5.8+ str helpers got removed you must use Illuminate\Support\Str::limit($string) instead

Try this one:

{{ \Illuminate\Support\Str::limit($product, 500, '...') }}
like image 124
TsaiKoga Avatar answered Sep 16 '22 13:09

TsaiKoga


Just install laravel helpers

composer require laravel/helpers

Repository

like image 28
mafortis Avatar answered Sep 17 '22 13:09

mafortis


Here is your solution. I hope it has helped you:

{{\Illuminate\Support\Str::limit($product, 500)}}
like image 27
Safaetul Ahasan Piyas Avatar answered Sep 20 '22 13:09

Safaetul Ahasan Piyas