MedicOneSystems / livewire-datatables

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

unable to search with scope column #42

Closed labomatik closed 3 years ago

labomatik commented 4 years ago

I have a column using a scope,

Column::scope('SelectGroupedCustomersNames', 'customer')
                ->truncate(30)
                ->label('Customers'),

if a add a search to it i'm having an issue:

Invalid argument supplied for foreach() (View: /resources/views/livewire/datatables/datatable.blade.php)

The scope is

$query->addSelect([
            $alias => Customers::selectRaw('GROUP_CONCAT(CONCAT(first_name," ",last_name) SEPARATOR " , ")')
                ->leftJoin('posts_customers', 'posts_customers.customer_id', 'customer.id')
                ->whereColumn('posts_customers.post_id', 'post.id')
        ]);

Any idea how i can debug this or identify the issue?

vwmoose commented 1 year ago

Did anyone manage to solve this?