From a84ff19451fd35ee95185c7a2718dea6520c090c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 18 Feb 2020 00:36:49 -0700 Subject: [PATCH] Update CollectionController, fix null bug --- app/Http/Controllers/CollectionController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php index 4fc7dfe6..e8354367 100644 --- a/app/Http/Controllers/CollectionController.php +++ b/app/Http/Controllers/CollectionController.php @@ -50,13 +50,13 @@ class CollectionController extends Controller return $request->all(); } - public function store(Request $request, int $id) + public function store(Request $request, $id) { abort_if(!Auth::check(), 403); $this->validate($request, [ 'title' => 'nullable', 'description' => 'nullable', - 'visibility' => 'required|alpha|in:public,private' + 'visibility' => 'nullable|string|in:public,private' ]); $profile = Auth::user()->profile; @@ -140,7 +140,7 @@ class CollectionController extends Controller return 200; } - public function get(Request $request, int $id) + public function get(Request $request, $id) { $profile = Auth::check() ? Auth::user()->profile : [];