dimanche 12 novembre 2017

How to show a part of details/body to read in Laravel so that I can use a clickable link to read the full body?

Sorry for this Very silly question. But I badly need it. I'm passing post details from the posts table using this in the controller:

$posts = post::where('status',1)->orderBy('created_at','DESC')->paginate(5);

In my posts table there are title,subtitle and body.

@foreach ($posts as $post)
                <div class="post-preview">

                    <a href="">
                        <h2 class="post-title">
                            
                        </h2>
                        <h3 class="post-subtitle">
                            
                        </h3>
                    </a>
                    <p class="post-meta"> </p>

                </div>
                @endforeach

so it is showing the title,subtitle and time. but I want to show the 2/3 lines from the body attribute, then want to use "see more" link.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2zB4JSo
via IFTTT

Aucun commentaire:

Enregistrer un commentaire