MedicOneSystems / livewire-datatables

Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS
https://livewire-datatables.com/
MIT License
1.19k stars 258 forks source link

'searchable()' for complex 'Coloumn::callback' functions. #548

Open rameezmeans opened 1 year ago

rameezmeans commented 1 year ago

I am using these queries. But searchable is not working. Can I see examples or docs?

Column::callback(['id', 'brand'], function ($id) {

  $file = File::findOrFail($id);
  return $file->brand.' '.$file->engine.' '.$file->vehicle()->TORQUE_standard;

})->label('Vehicle')->searchable(),
Column::callback('stages', function($stages){

                if(\App\Models\Service::where('name', $stages)->first()){
                    return '<img alt="{{$file->stages}}" width="33" height="33" data-src-retina="'. url("icons").'/'.\App\Models\Service::where('name', $stages)->first()->icon .'" data-src="'.url('icons').'/'.\App\Models\Service::where('name', $stages)->first()->icon.'" src="'.url('icons').'/'.\App\Models\Service::where('name', $stages)->first()->icon.'">
                                        <span class="text-black" style="top: 2px; position:relative;">'.$stages.'</span>';
                }
            })
            ->label('Stage')->searchable(),