Is this supposed to work?
<?php
$src = asset('assets/img/stuff.svg')->mediaUrl();
<img src="<?= $src ?>" alt="Stuff">
<pre>
<?= $src ?>
</pre>
The media url comes out like:
http://localhost/media/assets/assets/img/769830240-1667553438/stuff.svg
And the image doesn’t load.
If possible I’d like to use it for the built in cache busting fingerprint path. Do I have to manually copy the file into the media folder, and if yes, is there a more convenient way of doing this than:
$file = asset('assets/img/logo.svg');
if($file->asset()->exists() && !F::exists($file->mediaRoot())) {
F::copy($file->root(), $file->mediaRoot(), true);
}
Maybe something that does it asynchronously via a .jobs
file?