Skip to content
Advertisement

Laravel Modal Not Returning Data

I am not sure why I am not getting value in Laravel controller from modal. Please help me find it out.

But, I am using the same code for other modal and controller. It’s working, and it’s returning values in attribute without any issue.

I am using Laravel 8 with php 8.1;

enter image description here

Below is my codes.

appHttpControllersAdminMpdController.php

JavaScript

appModelsadminmpd.php

JavaScript

routesweb.php

JavaScript

Advertisement

Answer

Route model binding will automatically determine a variable name based on the name before it

For example: Route::resource('images', 'ImageController')

Will expect Image $image in the controller.

Use php artisan route:list and look for the value between the brackets and change the

JavaScript

to

JavaScript

Or alter the parameter name with the parameter function on the route resource definition

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