php - ArgumentCountError Too few arguments to function Laravel unable to pull data from db and display
one text
Solution:
This function request $id;
public function manage_students($id)
This route doesn't pass one
Route::get('admin/manage_students', 'AdminController@manage_students');
As I can see you are filtering by results which in this case you need $result id
Route::get('admin/manage_student/{id}', 'AdminController@manage_students');
So you have to pass result ID, but lets assume there is a default results id
public function manage_students($id=2)
then this route works because $id is optional/predefined.
Route::get('admin/manage_students', 'AdminController@manage_students');
And if you pass an ID it will use
Route::get('admin/manage_student/{id}', 'AdminController@manage_students');
Make 2 routes and make parameter optional/predefined.
if you go to /admin/manage_student it will use ID 2 but if you pass /admin/manage_student/5 it will use 5
Source