X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/193d7fb3fe71a76a43ebc1ccdb617b4b627d1e09..refs/pull/3069/head:/app/Http/Controllers/BookshelfController.php diff --git a/app/Http/Controllers/BookshelfController.php b/app/Http/Controllers/BookshelfController.php index da16d7822..32248ee46 100644 --- a/app/Http/Controllers/BookshelfController.php +++ b/app/Http/Controllers/BookshelfController.php @@ -84,9 +84,9 @@ class BookshelfController extends Controller { $this->checkPermission('bookshelf-create-all'); $this->validate($request, [ - 'name' => 'required|string|max:255', - 'description' => 'string|max:1000', - 'image' => 'nullable|' . $this->getImageValidationRules(), + 'name' => ['required', 'string', 'max:255'], + 'description' => ['string', 'max:1000'], + 'image' => array_merge(['nullable'], $this->getImageValidationRules()), ]); $bookIds = explode(',', $request->get('books', '')); @@ -161,9 +161,9 @@ class BookshelfController extends Controller $shelf = $this->bookshelfRepo->getBySlug($slug); $this->checkOwnablePermission('bookshelf-update', $shelf); $this->validate($request, [ - 'name' => 'required|string|max:255', - 'description' => 'string|max:1000', - 'image' => 'nullable|' . $this->getImageValidationRules(), + 'name' => ['required', 'string', 'max:255'], + 'description' => ['string', 'max:1000'], + 'image' => array_merge(['nullable'], $this->getImageValidationRules()), ]); $bookIds = explode(',', $request->get('books', ''));