X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/6cd26e23a800b35a5f83df77cb723d00c70a2dec..b8c16b15a9f945b72d2ca4fe0c0172ba422199bc:/app/Http/Controllers/BookshelfController.php diff --git a/app/Http/Controllers/BookshelfController.php b/app/Http/Controllers/BookshelfController.php index 5c9da762f..c46cac277 100644 --- a/app/Http/Controllers/BookshelfController.php +++ b/app/Http/Controllers/BookshelfController.php @@ -85,12 +85,12 @@ class BookshelfController extends Controller $this->validate($request, [ 'name' => 'required|string|max:255', 'description' => 'string|max:1000', - 'image' => $this->getImageValidationRules(), + 'image' => 'nullable|' . $this->getImageValidationRules(), ]); $bookIds = explode(',', $request->get('books', '')); $shelf = $this->bookshelfRepo->create($request->all(), $bookIds); - $this->bookshelfRepo->updateCoverImage($shelf); + $this->bookshelfRepo->updateCoverImage($shelf, $request->file('image', null)); Activity::add($shelf, 'bookshelf_create'); return redirect($shelf->getUrl()); @@ -148,7 +148,7 @@ class BookshelfController extends Controller $this->validate($request, [ 'name' => 'required|string|max:255', 'description' => 'string|max:1000', - 'image' => $this->imageRepo->getImageValidationRules(), + 'image' => 'nullable|' . $this->getImageValidationRules(), ]);