diff --git a/resources/views/galleries/index.blade.php b/resources/views/galleries/index.blade.php
index 562f8f2fa6..8ec98c3223 100644
--- a/resources/views/galleries/index.blade.php
+++ b/resources/views/galleries/index.blade.php
@@ -51,20 +51,18 @@
@endif
- @if ($gallery->submissions->where('status', 'Accepted')->count())
+ @if ($gallery->submissions()->where('status', 'Accepted')->count())
- @foreach ($gallery->submissions->where('is_visible', 1)->where('status', 'Accepted')->take(4) as $submission)
+ @foreach ($gallery->submissions()->where('is_visible', 1)->where('status', 'Accepted')->take(4)->get() as $submission)
@include('galleries._thumb', ['submission' => $submission, 'gallery' => true])
@endforeach
- @if ($gallery->submissions->where('status', 'Accepted')->count() > 4)
+ @if ($gallery->submissions()->where('status', 'Accepted')->count() > 4)
@endif
- @elseif(
- $gallery->children->count() &&
- App\Models\Gallery\GallerySubmission::whereIn('gallery_id', $gallery->children->pluck('id')->toArray())->where('is_visible', 1)->where('status', 'Accepted')->count())
+ @elseif($gallery->children->count() && App\Models\Gallery\GallerySubmission::whereIn('gallery_id', $gallery->children->pluck('id')->toArray())->where('is_visible', 1)->where('status', 'Accepted')->count())
@foreach (App\Models\Gallery\GallerySubmission::whereIn('gallery_id', $gallery->children->pluck('id')->toArray())->where('is_visible', 1)->where('status', 'Accepted')->orderBy('created_at', 'DESC')->get()->take(4) as $submission)