+ * @param array $input
+ * @return Book
+ */
+ public function createFromInput($input)
+ {
+ $book = $this->book->newInstance($input);
+ $book->slug = $this->findSuitableSlug($book->name);
+ $book->created_by = user()->id;
+ $book->updated_by = user()->id;
+ $book->save();
+ $this->permissionService->buildJointPermissionsForEntity($book);
+ return $book;
+ }
+
+ /**
+ * Update the given book from user input.
+ * @param Book $book