getPostsByType('post type name', 'all' or remove)
@foreach(getPostsByType(getContentBySlug(collect(request()->segments())->last())->post_type) as $post)
   <li>
       <div class="sidebar__post-image">
            <img src="{!! asset('public/uploads/' . $post->thumbnail_path) ?? '' !!}" alt="">
       </div>
       <div class="sidebar__post-content">
            <h3><a href="{{url($post->post_type, $post->slug)}}">{{$post->title}}1</a> </h3>
       </div>
   </li>
@endforeach  
For paginate:
Force all posts: @foreach(getPostsByType('products','all') as $post)  
Normal posts: @foreach(getPostsByType('products') as $post)  
'all' means all post and without 'all' means seleted paginate from back-end