Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ahmeda's avatar

How to upload image with Livewire?

in Livewire config:

'temporary_file_upload' => [
    'disk' => 'public_uploads',
    ....
],

The public_uploads is public/uploads/ so I move the temp file to public dir to make it easy when I deploy my app, everything in local works and fine

when I deploy the project then try to upload the image I got this error:

The avatar failed to upload.

I just check my console and got an error in the image:

https://i.stack.imgur.com/Wpk0y.png

0 likes
1 reply
divspace's avatar

Open app/Http/Middleware/TrustProxies.php and make sure you have this:

/**
 * The trusted proxies for this application.
 *
 * @var array|string|null
 */
protected $proxies = '*';

Please or to participate in this conversation.