I am making a page where posts are shown [by title and a part of body]. in my view page I am using {{$post->body}}
which shows the whole body of a post. And i cant think of any anything(helper,method) that gets some words at the beginning of body
try like below ...
{!! str_limit($post->body , 100) !!}
it will display 100 lenth of your text(you can also pass whatever number you wish instead of 100).
u can use substr()
method of php
examples:
<?php
$stringName="Hello world";
echo substr($stringName,6);//output= world
echo substr($stringName,0,5);//output= Hello
echo substr($stringName,1,6);//output= ello w
?>
in case of question
{{substr($post->body,0,15)."....."}}