markMngoma
131
0
Tips

Blog Post Card Float

Posted 2 months ago by markMngoma

Hello, I have written PHP Code to display blog posts and they do, however, I would like them to display in floating style on row, like how it is on Laracasts. Please advise me on how to do so.

Here is my code below:

Blade View Code:

<div class="row">
    <div class="col-md">
        <div class="card">
            <?=$post->image_tag("medium", true, ''); ?>
            <div class="card-body">
                <h5 class="card-title"><b>{{$post->title}}</b></h5>
                <p class="card-text"><b>{!! $post->generate_introduction(400) !!}</b></p>
            </div>
        </div>
    </div>
</div>

Here is the controller code:

$posts = $posts->orderBy("posted_at", "desc")
            ->paginate(config("blog.per_page", 10));

        return view("blog::index", [
            'posts' => $posts,
            'title' => $title,

        ]);

Please sign in or create an account to participate in this conversation.