Good Morning; I have a problem, is it possible to access the "Value" of serachBar input on the server side? Basically the problem is that I need to filter the query before "return Datatables";
$casa = Casa::where('client_id', Auth::user()->id)->first();
$guifftCards = guiftcarwin::where('casa', $casa->id)->orderBy('created_at','DESC')->select(['created_at','client_id' ,'id']);
return Datatables::of($guifftCards)
->editColumn('client_id',function ($guifftCard){
return HellperFunction::getUserName($guifftCard->client_id);
} )
->editColumn('id',function ($guifftCard){
return HellperFunction::makeValue($guifftCard->id);
} )
->make();
$casa = Casa::where('client_id', Auth::user()->id)->first();
$usersID = Users::where('name', 'LIKE', "%{$SEARCHBAR}%")->pluck('client_id');
$guifftCards = guiftcarwin::where('casa', $casa->id)->wherein('client_id',$usersID)->orderBy('created_at','DESC')->select(['created_at','client_id' ,'id']);
return Datatables::of($guifftCards)
->editColumn('client_id',function ($guifftCard){
return HellperFunction::getUserName($guifftCard->client_id);
} )
->editColumn('id',function ($guifftCard){
return HellperFunction::makeValue($guifftCard->id);
} )
->make();
Thanks !
Hi,
Maybe this can answer your question? https://datatables.yajrabox.com/fluent/custom-filter
You can access it using request('search.value')
. A more advance search can also be done using the link provided by @AdrienPoupa. Thanks!
Thanks AdrienPoupa, it do the job !!
Most helpful comment
Hi,
Maybe this can answer your question? https://datatables.yajrabox.com/fluent/custom-filter