Do you know why this code "<a href="{{route('posts.show', ['id' => 'post.id', 'slug' => post.slug])}}" class="btn btn-primary text-white">More</a>" in the code below shows Use of undefined constant post - assumed 'post'?
    $.each(result, function(index, post) {
            newPosts += '<div class="col-12 col-sm-6 col-lg-4 col-xl-3 mb-4">\n' +
'                        <div class="card box-shaddow">\n' +
+'                            <div class="card-body">\n' +
+'                                <h5 class="card-title h6 font-weight-bold text-heading-blue">'+post.name+'</h5>\n' +
+'                            </div>\n' +
'                            <div class="card-footer d-flex justify-content-between align-items-center">\n' +
'                                 <a href="{{route('posts.show', ['id' => 'post.id', 'slug' => post.slug])}}" class="btn btn-primary text-white">More</a>
'       <span class="font-weight-bold font-size-sm text-heading-blue"> </span>\n' +
'                            </div>\n' +
'                        </div>\n' +
'                    </div>';
        });
 
    