Upload image with PUT does not work in Production (digital ocean) – Laravel and vue

I have a weird problem: Uploading a image in local WORKS perfectly but when I upload to Production in digital ocean it does NOT.

Iam using laravel 11, vue 3 and InertiaJS

What happens in Production its that a zero 0 value its stored instead the usual path and the image does not. Another weird thing its that I have another form with POST method which already works on production. I tried to change this form to POST but still failing.

How front works: A button opens a modal and that action select a player who owns a photo. The player data its filled in the form and the input file allows to select new photo which its included in the Inertia JS form. In the useForm I include the _method: 'PUT' because PHP has problemas sending files directly with PUT method and laravel allows override the POST method form.

  1. When The modal its opened by method @click="openUpdatePlayer(user)"the field photo its filled with the current photo formPlayer.photo = player.photo;

FILE Field

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><TextInput
id="photo"
name="photo"
type="file"
placeholder = "Foto del jugador"
class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm"
@input="formPlayer.photo = $event.target.files[0]"
/>
<PrimaryButton
class="ms-3"
:class="{ 'opacity-25': formPlayer.processing }"
:disabled="formPlayer.processing"
@click="updatePlayer()"
>
Actualizar
</PrimaryButton>
</code>
<code><TextInput id="photo" name="photo" type="file" placeholder = "Foto del jugador" class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm" @input="formPlayer.photo = $event.target.files[0]" /> <PrimaryButton class="ms-3" :class="{ 'opacity-25': formPlayer.processing }" :disabled="formPlayer.processing" @click="updatePlayer()" > Actualizar </PrimaryButton> </code>
<TextInput
                    id="photo"
                    name="photo"
                    type="file"
                    placeholder = "Foto del jugador"
                    class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm"
                    @input="formPlayer.photo = $event.target.files[0]"
                />
<PrimaryButton
                    class="ms-3"
                    :class="{ 'opacity-25': formPlayer.processing }"
                    :disabled="formPlayer.processing"
                    @click="updatePlayer()"
                >
                    Actualizar
                </PrimaryButton>

Form player

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>const formPlayer = useForm({ //I let just some fields for visualization purposes
weight: 0,
height: 0,
email: null,
photo: null,
_method: 'PUT'
</code>
<code>const formPlayer = useForm({ //I let just some fields for visualization purposes weight: 0, height: 0, email: null, photo: null, _method: 'PUT' </code>
const formPlayer = useForm({ //I let just some fields for visualization purposes  
weight: 0,
height: 0,
email: null,
photo: null,
_method: 'PUT'

});

Form code

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>const updatePlayer = () => {
formPlayer.post(route('playerUpdate', formPlayer.id), {
//onFinish: () => formPlayer.reset(),
onSuccess: () => closePlayerModal(),
});
</code>
<code>const updatePlayer = () => { formPlayer.post(route('playerUpdate', formPlayer.id), { //onFinish: () => formPlayer.reset(), onSuccess: () => closePlayerModal(), }); </code>
const updatePlayer = () => {
formPlayer.post(route('playerUpdate', formPlayer.id), {
    //onFinish: () => formPlayer.reset(),
    onSuccess: () => closePlayerModal(),
});

};

CONTROLLER CODE

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>if ($request->hasFile('photo')) {
$image = $request->file('photo')->store('photos', 'public');
$user->photo = $image;
} else {
dd('error uploading photo', $request->file('photo'));
}
</code>
<code>if ($request->hasFile('photo')) { $image = $request->file('photo')->store('photos', 'public'); $user->photo = $image; } else { dd('error uploading photo', $request->file('photo')); } </code>
if ($request->hasFile('photo')) {
        $image = $request->file('photo')->store('photos', 'public');
        $user->photo = $image;
    } else {
        dd('error uploading photo', $request->file('photo'));
    }

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật