Kaynağa Gözat

Update CollectionController, limit unpublished collections to owner

Daniel Supernault 3 yıl önce
ebeveyn
işleme
a0061eb56c
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      app/Http/Controllers/CollectionController.php

+ 3 - 0
app/Http/Controllers/CollectionController.php

@@ -237,6 +237,9 @@ class CollectionController extends Controller
 
         return Collection::whereProfileId($profile->id)
         	->whereIn('visibility', $visibility)
+        	->when(!$owner, function($q, $owner) {
+        		return $q->whereNotNull('published_at');
+        	})
             ->orderByDesc('id')
             ->paginate(9)
             ->map(function($collection) {