I'm using laravel collection `random` to get some of other posts in single post blade but the problem is when i don't have more that 6 posts i'll get error of 
`You requested 6 items, but there are only 1 items in the collection.`

So now I need to make an if statement to say get random posts from 0 to 6 which means if for example i have only one post and i'm in view of that post so ignore of getting other posts (cause there is no other post!) and if i have 2 posts in total get only other one and so on... till maximum 6 posts in random order.

here is my function:

```
public function show($slug) {
      $post = Post::where('slug', $slug)->firstOrFail();
      $postfeatures = Post::all()->random(6);
      $subcategories = Subcategory::with('posts')->get();
      $categories = Category::all();
      $advertises = Advertise::inRandomOrder()->where('status', '1')->first();
      return view ('frontend.single', compact('post', 'categories', 'subcategories', 'postfeatures', 'advertises'));
    }

```

Here is my view:

```
<ul class="gallery">
   @foreach($postfeatures as $postss)
     <li><a data-toggle="tooltip" data-placement="top" title="{{ $postss->title }}" href="{{ route('frontshow', $postss->slug ) }}"><img src="{{ url('images/') }}/{{ $postss->image }}" class="img-responsive" alt="{{ $postss->title }}"></a></li>
   @endforeach
</ul>

```

Thanks.