Open eduardoarandah opened 6 years ago
Hello @eduardoarandah
I can solve the problem, I'm reviewing the same and I have not been able to find the solution to apply the filter correctly.
At this moment the request is sent to the server but it does not search.
What I did is the following:
public function getUsersForVueDataTable(Request $request)
{
$request->request->add(['searchable' =>[ 'name', 'email', 'created_at']]);
$query = User::select([
'id',
'name',
'email',
'created_at',
]);
return Vuetable::of($query)->make();
}
I do not think it is the most optimal solution but it works correctly.
Because I tried to add the query-params, but this did not work for me:
queryParams: {
sort: 'sort',
page: 'page',
perPage: 'per_page',
searchable: [
'name',
'email',
'created_at',
],
},
This is the request object when I use the query-params but it does not take the variable
array:4 [
"sort" => null
"page" => "1"
"per_page" => "5"
"filter" => "andres"
]
Notes for lesson 13: https://github.com/ratiw/vuetable-2-tutorial/wiki/lesson-13
If you are using this package in laravel for your API https://github.com/santigarcor/laravel-vuetable
You need an extra param called "searchable"
Example
method: