在 Laravel 视图中调用未定义的函数

Call to undefined function in Laravel view

我的 Laravel 网站主页中有一个 About Us 部分。我已经从 about us 页面中显示的管理面板为 About Us 上传了一篇巨大的文章。但是我想在首页显示about us的具体字数,然后在后面加上read more。当点击 read more 时,它会转到 about us 页面。

但是我无法在我的主页上显示那篇文章的具体字数。

我使用了 echo word_teaser_end($about_us[0]->details, 10); 函数,但它给出了错误

Call to undefined function word_teaser_end() (View: E:\xampp\htdocs\OFFICE\SEN_CARE\sencare.com.bd\resources\views\frontend\home\home.blade.php)

我现在该怎么办?

我不知道 word_teaser_end() 因为它是定义函数, 尝试 str_limit() 辅助函数,它可以帮助您从字符串

中加载单词数
{{ str_limit($string,'10') }}

https://laravel.com/docs/5.6/helpers#method-str-limit

这应该有所帮助。

{!! str_limit($string,'10') !!}