Have you use Datatable js or css library link and check on console.log are you getting data or not
for more information check link
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
how to display dynamic data in datatable
here is my controller code
public function json_view()
{
$view = Pg::all();
return response()->json(['data'=>$view]);
}
here is my datatable.js
datatable = $('#kt_apps_user_list_datatable').KTDatatable({
data: {
type: 'remote',
source: {
read: {
url: "/pg/display",
method:'GET',
},
},
columns: [
{
field: "name",
title: "Name",
width: 200,
Name : {data: "name"}
}]
}
here is my route file
Route::get('pg/display','Pages\PgController@json_view')->name('json_view');
i try to display data into datatable but not working please wait message display
thanks
that mean "/pg/display" you are not hiting on that url are you using full path like http://localhost/projects/pg/display do hit or not check on network ctrl+shift+i
Please or to participate in this conversation.