Răsfoiți Sursa

Update CollectionController, limit unpublished collections to owner

Daniel Supernault 3 ani în urmă
părinte
comite
a0061eb56c
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  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) {