i have problem on my code, i cant pass uploaded file into the request this is my form
<form method="POST" action="" autocomplete="off" enctype="multipart/form-data"> @method('PUT') @csrf <div class="form-group focused"> <label for="avatar" class="form-control-label">Profile Pic <span class="small text-danger">*</span></label> <input type="file" class="form-control-file" name="avatar" id="avatar" accept=".jpeg,.jpg,.png"> </div></form>
i tried to dump my request variable in my update method in user controller but it return null
dd($request->file('avatar'));
please help me, ill be very helpful btw sorry for my bad english
https://stackoverflow.com/questions/66949260/cant-upload-image-files-using-laravel April 05, 2021 at 02:51PM
没有评论:
发表评论