Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Join other table in the inertiaTable QueryBuilder request #81

Open
landryjohn opened this issue Aug 10, 2022 · 0 comments
Open

Join other table in the inertiaTable QueryBuilder request #81

landryjohn opened this issue Aug 10, 2022 · 0 comments

Comments

@landryjohn
Copy link

I wish to know the proper way to write a querybuilder request for inertia table which can make me use foreign fields in the table. (As weel as fields concatanations).

When i use for instance

$orders = QueryBuilder::for(Order::class) ->defaultSort('created_at')
->allowedIncludes(['user'])
->select('orders.id', 'orders.total_price',
DB::raw("concat(users.last_name, ' ', users.first_name) as full_name"),
'orders.paid', 'orders.shipped', 'orders.created_at', 'users.email')
->join('users', 'orders.user_id', '=', 'users.id')
-> ...

It works, but i lost all the datatables functionnalities (Filter, Search, Sort, ...)

Thank

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant