@muuucho you will need to use helpers to show your image. For example, use storage_path or public_path.
The way you have it set, it will use the page URL that you are currently on, that is why it changes.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have problem displaying the same image file in two components, but the image only shows in one of them. I have shorten down all scripts to a minimum just to narrow down the problem but I can't find whats wrong. The paths to the image in the same blade file are for some reason different dependeing which component is rendering the view. Please have a look: Routes:
Route::get('invoices', \App\Livewire\Invoices\All::class)->name('invoices.all');
Route::get('invoices/{invoice}', \App\Livewire\Invoices\Form::class)->name('invoices.edit');
All.php
<?php
namespace App\Livewire\Invoices;
use Illuminate\Contracts\View\View;
use Livewire\Component;
class All extends Component
{
public function render(): View
{
return view('livewire.invoices.x');
}
}
Form.php
<?php
namespace App\Livewire\Invoices;
use Illuminate\Contracts\View\View;
use Livewire\Component;
class Form extends Component
{
public function render(): View
{
return view('livewire.invoices.x');
}
}
x.blade.php
<div>
<embed src="storage/x.jpg"/>
</div>
When I enter http://gnirt.test/invoices in the browser the imgage is there But when I enter http://gnirt.test/invoices/3 in the browser the image is gone.
If I inspect the code and hover the image link storage/x.jpg, the paths are for some reason different.
In http://gnirt.test/invoices the path is http://gnirt.test/storage/x.jpg CORRECT
In http://gnirt.test/invoices/3 the path is: http://gnirt.test/invoices/storage/x.jpg WRONG
So, where did invoices came from and how do I get rid of it?
Please or to participate in this conversation.