Is it possible to tell paginate to retrieve columns from joined tables? I could return the whole thing but if I could tell it to only retrieve the columns I want it would save writing a lot of JS
This is my query
$schedulesJson = Schedule::JsonBuilder()->with('customer')->with('user')->where('tblschedules.owner_id', $user->owner_id);
Schedule::$pageLimit = $request['num_results'];
// I return $schedulesJson from the repository to my controller where it's named $schedules
$schedules = $schedules->paginate(1, ['shift_date', 'shift_start', 'shift_end', 'customer_name', 'user_displayname']);
`
I've tried 'tblcustomers.customer_name', 'customer[customer_name]', 'customer.customer_name', and 'tblcustomers.customer_name'
Then I try to paginate and retrieve columns from the joined tables, I get the columns that are in the base table (schedules) but not the joined tables. I'm aware I can just forego the second parameter but I'd like to just retrieve the ones I want.
So for some reason if I use Mysqlidb rawQuery to do the same exact query, it returns, I'm not sure why I'm unable to select values from joined tables when using DbObject.
Is it possible to tell paginate to retrieve columns from joined tables? I could return the whole thing but if I could tell it to only retrieve the columns I want it would save writing a lot of JS This is my query
` I've tried 'tblcustomers.customer_name', 'customer[customer_name]', 'customer.customer_name', and 'tblcustomers.customer_name' Then I try to paginate and retrieve columns from the joined tables, I get the columns that are in the base table (schedules) but not the joined tables. I'm aware I can just forego the second parameter but I'd like to just retrieve the ones I want.