repository->findByHash($hash); } /** * 이미지 스트림 응답 생성 * * @param Ckeditor5ImageUpload $image 이미지 업로드 모델 * @return StreamedResponse|null 이미지 스트림 또는 스토리지 파일 없을 경우 null */ public function serve(Ckeditor5ImageUpload $image): ?StreamedResponse { // file_path 형태: "images/2026/04/06/{uuid}.jpg" // PluginStorageDriver::response(category, path) 에서 category = 'images' $category = 'images'; $relativePath = substr($image->file_path, strlen($category) + 1); $response = $this->storage->response( $category, $relativePath, $image->original_name, [ 'Content-Type' => $image->mime_type, 'Cache-Control' => 'public, max-age=31536000', ] ); if (! $response) { Log::error('CKEditor5 이미지 스토리지에 없음', [ 'image_id' => $image->id, 'hash' => $image->hash, 'file_path' => $image->file_path, 'disk' => $image->storage_disk, ]); return null; } return $response; } }