My table is designed for the controller, I want to append this table to the table in the blade of laravel.
This is my table in controller:
$subLaws='';
$n=1;
foreach($sublaw as $sLaw)
{
$govt_no='';
$eventType='';
$status='Inactive';
$url=url('admin/sublawmaster/'.$sLaw->id);
$lmsid=$sLaw->lms_id;
$view_url=url('admin/sublawmaster/view/' .$sLaw->id);
if($sLaw->status=='1'){$status='Active';}
$subLaws .= '<tr class="odd">
<td></td>
<td><a href="'.$view_url.'">'.$lmsid.'</a></td>
<td>'.$sLaw->sub_law_name.'</td>
<td>'.$eventType.'</td>
<td><span class="label label-success
btn_status">'.$status.'</span></td>
$n++;
}
return json_encode($subLaws);
this is my ajax code:
$.ajax({
type: 'GET',
dataType: "json",
data: {law_id:id},
url: "{{ URL::to('admin/postlawid/') }}",
success: function (data) {
}
});
this is my table in blade file:
<table class="table table-striped table-bordered table-hover" id="sublawmasterdata">
<thead>
<tr id="header">
<th align="center" width="80" style="text-align:center;">S NO</th>
<th>LMS ID</th>
<th>LMS Name</th>
<th>LMS Type</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
I have a dropdown when the value is selected from this dropdown the table in the controller should get appended to the table in blade file. how should I append the table in the controller to the table in blade file?