Closed bilogic closed 3 years ago
Hi, I am using links, and I have no such problem. Maybe join is affecting. It would be great to see the result of what is returned in its purest form.
Try to write those in the same way as I do:
return $builder->whereHas('contacts', function (Builder $query) {
$searchTerm = $this->request->get('search');
$query
->where('surname', 'LIKE', '%' . $searchTerm . '%')
->orWhere('email', 'LIKE', '%' . $searchTerm . '%');
});
Yes, thank you! Yours worked! Strange, what did I do wrong?
@tabuna sorry to sidetrack a bit, is there a way to apply QueryFilter.php
to a column instead of the table?
contacts
andpayments
, related bypayments.contact_id
I wrote a
QueryFilter.php
forpayments
filtering by usingcontacts
informationIn my
Payments.php
resource, I had to do this:payments.id
andcontacts.id
shows the correct valuespayments.id
shows the value ofcontacts.id
Thank you.