MedicOneSystems / MedicOneSystems/livewire-datatables

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

Open
#548 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

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(),

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two Column::callback examples in the issue and review how callback columns are documented and handled by the searchable() option. Reproduce the reported queries, then clarify whether the expected result is working complex callbacks or documentation with supported examples; done means the behavior or usage is documented and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.