Route::post('/profile.settings', [\App\Http\Controllers\ProfileController::class, 'UploadImage'])->name('upload.image');
const formData = new FormData();
const file = fileInput.files;
if (file.length > 0){
console.log("больше 0");
}
const fileInput = document.getElementById('avatar-upload');
const form = document.getElementById('avatar-form');
const formData = new FormData();
const file = fileInput.files;
formData.append("avatar-upload",file);
// Fetch запрос
fetch('/api/profile.settings', {
method: 'POST',
enctype: 'multipart/form-data',
body: formData,
})
const fileInput = document.getElementById('avatar-upload');
const form = document.getElementById('avatar-form');
const formData = new FormData();
const file = fileInput.files;
formData.append("avatar-upload",file);
// Fetch запрос
fetch('/api/profile.settings', {
method: 'POST',
enctype: 'multipart/form-data',
body: formData,
})