-
- /**
- * Common actions to run on bookshelf update.
- * @param Bookshelf $shelf
- * @param Request $request
- * @throws \BookStack\Exceptions\ImageUploadException
- */
- protected function shelfUpdateActions(Bookshelf $shelf, Request $request)
- {
- // Update the books that the shelf references
- $this->entityRepo->updateShelfBooks($shelf, $request->get('books', ''));
-
- // Update the cover image if in request
- if ($request->has('image') && userCan('image-create-all')) {
- $image = $this->imageRepo->saveNew($request->file('image'), 'cover', $shelf->id);
- $shelf->image_id = $image->id;
- $shelf->save();
- }
- }