F
F
fuckman2014-10-21 22:56:11
Laravel
fuckman, 2014-10-21 22:56:11

Laravel - how to organize text preview for posts?

I am learning Laravel and practicing along the way by developing a blog. There was a problem: how to organize a text preview for a post? Is it possible using Laravel to limit the number of returned characters of a field of type text in the mysql database?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Viktor Vsk, 2014-10-21
@viktorvsk

https://www.google.com.ua/search?q=laravel+truncat...

W
WebSpider, 2014-10-22
@WebSpider

php.net/mb_substr

C
claymor, 2014-11-14
@claymor

It is convenient to use the helper for previews of blog articles:
Str::words($text, 20); - will return the first 20 words of the text

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question