Closed byrondcortez closed 4 years ago
How are you using the relationship?
What SQL does the query execute when you log it with \DB::enableQueryLog(); [...] dump(\DB::getQueryLog());
or a tool like debugbar?
Hi, I got it. I updated the query to alias the id of the target child:
$query = \App\LoanRequest::with([
'approvers' => function($q) {
$q->select('approval_item_employee.id as approval_item_employee_id', 'can_approve', 'approver_id', 'remarks', 'attachments', 'approval_item_employee.updated_at');
},
])
Thank you for this library!
I have this hasManyDeep relationship:
when I include this relationship with (::with), I get the id of \App\ApprovalRequest. Is there a way for me to get \App\ApprovalItemEmployee's id instead?