Skip to content
Advertisement

how to update existing product in laravel?

I’m trying to edit existing property’s listings in my laravel application using the following method

ListingController

JavaScript

the edit.blade.php

JavaScript

I tried using this method but was confronted with this error SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘balcony’ cannot be null. I don’t want the user to be required to fill everything just new data that is needed to be added. Please how can I displayed existing data on the select box and file input?. is there a better way to do this?

Advertisement

Answer

JavaScript

as you can see in the balcony section code, you don’t have value attribute on your options element so it should be like that

JavaScript

Besides that you can change the default value to Nullable of the column fields which are not required fields through phpmyadmin or through migrations and refresh the migrations again like:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement