Php 我的Datatable在laravel视图中无法正常工作
我在我的laravel应用程序中使用jquery数据表从视图中的表中的控制器获取数据 我的观点是Php 我的Datatable在laravel视图中无法正常工作,php,jquery,datatables,Php,Jquery,Datatables,我在我的laravel应用程序中使用jquery数据表从视图中的表中的控制器获取数据 我的观点是 <table class="table table-bordered data-table" id="products_sold"> <thead> <tr> <th>Product Name</th>
<table class="table table-bordered data-table" id="products_sold">
<thead>
<tr>
<th>Product Name</th>
<th>Seller Name</th>
<th>Brand</th>
<th>Product Price</th>
<th>Shipping Price</th>
</tr>
</thead>
</table>
这是在我的控制器功能内
public function sold_products(){
$uid = Auth::user()->id;
$product = Product::where('buyer_id','!=',0)->where('seller_id',$uid)->get();
return Response::json([
'data' => $product
], 200);
}
我不知道遗漏了什么,有人能帮我在表中显示我的数据吗你有没有收到任何错误?没有JYOTHI…我没有收到任何错误可能是它会有帮助尝试它不应该
“ajax”:“{route('user.salled_products')},
作为url?是的,我给出了路由名称route::get(“已售出产品”、“用户”\DashboardController@sold_products')->name('user.salled_products');
像这样
public function sold_products(){
$uid = Auth::user()->id;
$product = Product::where('buyer_id','!=',0)->where('seller_id',$uid)->get();
return Response::json([
'data' => $product
], 200);
}