Skip to content
Advertisement

Encountering “404 NOT FOUND” for Laravel update/edit

in edit_customer:

JavaScript

web.php //Customer related pages

JavaScript

Profile.php (controller)

JavaScript

Advertisement

Answer

You are using route group prefix “customer”, so your url in the form should be prefixed

url(‘customer/update_customer’, [ ‘cust’ => $cust->id ]

https://laravel.com/docs/8.x/routing#route-group-prefixes

JavaScript

Your url for the from, to hit the update_customer function should be customer/update_customer/{id}

so this

JavaScript

should look like this

JavaScript

And a good practice is tou use route name instead of urls, so better to be

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