Level 11
You can use the package described in this article, we use a similar approach at my job, and it works well!
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I created a page to upload images. I use javascript to enhance the appearance. I want to apply the language translation to the CHANGE button in the xxx.js. script. If the html tag is in the blade as usual I use the {{trans ('global.CHANGE')}} pattern. But how do you write if the CHANGE button code is at xxx.js? How do I write in the javascript code in the xxx.js file? the following code code xxx.js:
fileReader.onload = function(e) {
// Show thumbnail and remove button.
$fileTab.prepend(getImageThumbnailHtml(e.target.result));
$browseFileButton.find('span').text('CHANGE');
$removeFileButton.css('display', 'inline-block');
};
Or is there another way?
Please or to participate in this conversation.