sess->get('user_id') === null) return Response::json(['error' => 'unauthorized'], 401); $uuid = (string)($params['uuid'] ?? ''); $path = $this->snaps->pathByUuid($uuid); if ($path === null || !is_file($path)) return Response::json(['error' => 'not_found'], 404); return Response::bytes((string)file_get_contents($path), 'image/jpeg', 200); } }