Hello, i need to add query for datatable where i need to filter by column. and i am using datatable controller and view for all the other datattable as well. SO please guide me how i can add Filter query dynamically that only one datatable get affected. Thanks
<?php
use App\Http\Helpers\Settings;
use App\Models\User;
use Illuminate\Support\Facades\Storage;
use koolreport\datagrid\DataTables;
use koolreport\processes\Filter;
DataTables::create(array(
"title" => $this->title,
"name" => $this->name,
'dataSource' => function () {
return $this->src('mysql')
->query('select * from ' . $this->datasource)
->pipe(new \koolreport\processes\Map([
"{value}" => function ($row) {
$btn = '';
foreach ($this->actions_btn as $key => $value) {
if ($key == 'deletebtn') {
$btn .= '<a onclick="deleteFunc(' . $row['id'] . ')" class="btn btn-danger btn-sm m-1 px-2">' . $value['icon'] . '</a>';
} else {
$btn .= '<a href="' . route($this->route . $value['route'], $row['id']) . '" class="btn btn-info btn-sm m-1 px-2">' . $value['icon'] . '</a>';
}
$row['Actions'] = $btn;
}
return $row;
}
]));
},
"columns" => $this->column,
"plugins" => $this->plugins,
"options" => $this->options,
"serverSide" => true,
));