Laravel yajra datatable: cannot retrieve the search parameter from ajax call in controller

末鹿安然 提交于 2019-11-28 14:40:31

Looks like the ? in the Route is not used to define an optional parameter but a string instead:

Route::get('exams/student/get-exam-attempts/{user_slug}/{exam_slug?}', 'StudentQuizController@getExamAttemptsData');

Could you please change it and see what you get?

Route::get('exams/student/get-exam-attempts/{user_slug}/{exam_slug}', 'StudentQuizController@getExamAttemptsData');

Also, the query string you posted has a space after myyser123, this could also explain the issue.

http:// localhost/lcbs/exams/student/get-exam-attempts/myuser123 ?draw=2&columns%5B0%5D%5Bdata%5D=0......search%5Bregex%5D=false&batch=22&_=1541684388689.

So I would suggest to check how the value is defined in the javascript code

url: '{{ $routeValue }}',
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!