Skip to content
Advertisement

Update() in Laravel does not seem to be working

I’m working with Laravel 5.8 to develop my project and I have this table which shows some data from the DB:

JavaScript

As you can see there’s a link named Edit for editing these data, so when someone clicks on that, this method runs:

JavaScript

I have also added this form for updating the data sent to the edit.blade.php:

JavaScript

And here is the method for updating data:

JavaScript

But now the problem is, data does not be changed and updated somehow and shows this as dd($e):

enter image description here

So what is going wrong here? How can I fix this issue?

And finally here is the Model ProductDelivery.php:

JavaScript

And the table product_deliveries looks like this:

enter image description here

UPDATE #1:

Result of dd($productDelivery->toArray()); goes like this:

JavaScript

Advertisement

Answer

Your input is disabled and disabled fields are not submitted with the request.

JavaScript

try using readonly="readonly" instead of disabled, or omit the field from the request entirely if it should not be changed.

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