From 1be16682dbb6c07e861d6362fc92b011fc4a4e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santoro=20Zambon?= Date: Fri, 22 Nov 2024 11:13:11 -0300 Subject: [PATCH] Fix asset paths for non-root project setups Replaced hardcoded asset paths with `asset()` helper to ensure assets are loaded correctly when the project is served from a subdirectory. This change modifies the script and stylesheet links in the HTML string to dynamically generate the correct paths, supporting projects served from a path other than the root. --- src/helpers.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/helpers.php b/src/helpers.php index 378b5d8..c95e300 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -32,9 +32,12 @@ function translationsUIAssets(): HtmlString $manifest = json_decode(file_get_contents($manifestPath), true); + $file = asset("/vendor/translations-ui/{$manifest['resources/scripts/app.ts']['file']}"); + $css = asset("/vendor/translations-ui/{$manifest['resources/scripts/app.ts']['css'][0]}"); + return new HtmlString(<< - + + HTML ); }