From 031c93915eaf10af5474fa2b39713fe79b0ad590 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 17 Jul 2019 23:28:16 -0600 Subject: [PATCH] Update CollectionController --- app/Http/Controllers/CollectionController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php index 88454766c..43f1e476e 100644 --- a/app/Http/Controllers/CollectionController.php +++ b/app/Http/Controllers/CollectionController.php @@ -79,6 +79,9 @@ class CollectionController extends Controller ]); $profile = Auth::user()->profile; $collection = Collection::whereProfileId($profile->id)->findOrFail($id); + if($collection->items()->count() == 0) { + abort(404); + } $collection->title = e($request->input('title')); $collection->description = e($request->input('description')); $collection->visibility = e($request->input('visibility'));