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

onurzdgn's avatar

Livewire image upload returns 401

I'm trying to upload an image to CloudFlare from DigitalOcean's App platform with Laravel 10 and Livewire 3. I wrote a service for this and this service api was written according to CloudFlare's api document. My project runs smoothly on local, but on my production server, when I press the "Select File" button, mark the file, and then press the "Open" button, it gives an error. When I look at the console, I see the error "Failed to load resource: the server responded with a status of 401 ()". What could be the problem with this and how can I solve it?

There are no error on logs and no error return to screen (APP_DEBUG=true).

0 likes
2 replies
Nakov's avatar

401 is Unauthorized error code, so maybe you forgot to add the API key in your .env file on production or maybe your config is cached so you will have to run php artisan config:clear.

Please or to participate in this conversation.