Hello,
I am currently using the library of Laravel 8 Yajra Datatables (GitHub: https://github.com/yajra/laravel-datatables) to visualize datatables.
Now I have a problem:
When calling the URL a number is sent ($employeeId). This is needed to set the table filter.
The problem is that all records are displayed (without filtering by $employeeId).
Do you see the problem?
Web:
Route::get('employee_course_overview/{employeeId}', [LeatroController::class, 'employeeCoursesOverview'])->name('employeeCourseOverview');
Controller:
public function employeeCoursesOverview(Request $request , $employeeId)
{
if ($request->ajax()) {
$data = Leatro::join('employees', 'employees.persnum', '=', 'leatros.employee_id')
->where('employees.persnum', $employeeId);
return Datatables::of($data)
->addIndexColumn()
->make(true);
}
return view('rowdatas.leatros_employee_overview.coursesOverview');
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community