@@ -34,8 +34,8 @@ protected function rules(): array
3434 }
3535
3636 /**
37- * Get a listing of gallery images and drawings in the system.
38- * Requires visibility of the content they're originally uploaded to.
37+ * Get a listing of images in the system. Includes gallery (page content) images and drawings .
38+ * Requires visibility of the page they're originally uploaded to.
3939 */
4040 public function list ()
4141 {
@@ -50,6 +50,11 @@ public function list()
5050
5151 /**
5252 * Create a new image in the system.
53+ * Since "image" is expected to be a file, this needs to be a 'multipart/form-data' type request.
54+ * The provided "uploaded_to" should be an existing page ID in the system.
55+ * If the "name" parameter is omitted, the filename of the provided image file will be used instead.
56+ * The "type" parameter should be 'gallery' for page content images, and 'drawio' should only be used
57+ * when the file is a PNG file with diagrams.net image data embedded within.
5358 */
5459 public function create (Request $ request )
5560 {
@@ -69,6 +74,10 @@ public function create(Request $request)
6974
7075 /**
7176 * View the details of a single image.
77+ * The "thumbs" response property contains links to scaled variants that BookStack may use in its UI.
78+ * The "content" response property provides HTML and Markdown content, in the format that BookStack
79+ * would typically use by default to add the image in page content, as a convenience.
80+ * Actual image file data is not provided but can be fetched via the "url" response property.
7281 */
7382 public function read (string $ id )
7483 {
@@ -78,7 +87,8 @@ public function read(string $id)
7887 }
7988
8089 /**
81- * Update an existing image in the system.
90+ * Update the details of an existing image in the system.
91+ * Only allows updating of the image name at this time.
8292 */
8393 public function update (Request $ request , string $ id )
8494 {
@@ -94,6 +104,8 @@ public function update(Request $request, string $id)
94104
95105 /**
96106 * Delete an image from the system.
107+ * Will also delete thumbnails for the image.
108+ * Does not check or handle image usage so this could leave pages with broken image references.
97109 */
98110 public function delete (string $ id )
99111 {
0 commit comments