fares.shawa's avatar

Edit a File Upload

Hello, I'm sorry if the question is not self-explanatory, but my question is:

I have this form here which works perfectly fine when i'm creating a new user.

{!! Form::model($employee, ['route'=>['EmployeeUpdate', $employee->id], 'method'=>'PATCH', 'class'=>'form']) !!}

{!! Form::file('employee_image', null, ['class'=>'form-control m-t-xxs', 'placeholder'=>'Employee Image']) !!}

But when I edit the code doesn't show the old value for File input type, for example this code works fine

{!! Form::text('fname', null, ['class'=>'form-control m-t-xxs', 'placeholder'=>'First Name']) !!}

and all other input fields work fine, except the file upload, any help will be appreciated.

0 likes
2 replies
tykus's avatar

You cannot repopulate a file input like your would text fields.

What you can do is make that file input to be optional on the edit form and only update the path if a new file has been uploaded.

fares.shawa's avatar

Ah too bad, guess then I can try that or I could try to display the image as a block and add an edit button to it for updating.

Please or to participate in this conversation.