X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/be1d6915298d385f55fa22ae31e38454a5154ba1..refs/pull/3630/head:/app/Http/Controllers/BookController.php diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index 681ed96bb..c5b6d0bf6 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -88,10 +88,11 @@ class BookController extends Controller public function store(Request $request, string $shelfSlug = null) { $this->checkPermission('book-create-all'); - $this->validate($request, [ + $validated = $this->validate($request, [ 'name' => ['required', 'string', 'max:255'], 'description' => ['string', 'max:1000'], 'image' => array_merge(['nullable'], $this->getImageValidationRules()), + 'tags' => ['array'], ]); $bookshelf = null; @@ -100,7 +101,7 @@ class BookController extends Controller $this->checkOwnablePermission('bookshelf-update', $bookshelf); } - $book = $this->bookRepo->create($request->all()); + $book = $this->bookRepo->create($validated); if ($bookshelf) { $bookshelf->appendBook($book); @@ -163,6 +164,7 @@ class BookController extends Controller 'name' => ['required', 'string', 'max:255'], 'description' => ['string', 'max:1000'], 'image' => array_merge(['nullable'], $this->getImageValidationRules()), + 'tags' => ['array'], ]); if ($request->has('image_reset')) {