Support the ongoing development of Laravel.io →
Laravel Eloquent
Last updated 1 year ago.
0
Solution

Please try:


$finder = Auth::user()->client()->where(function($innerQuery) { $innerQuery->where('business_name', 'LIKE', '%' . $query . '%') ->orWhere('vat_number', 'LIKE', '%' . $query . '%') ->orWhere('fiscal_code', 'LIKE', '%' . $query . '%'); });


It will look for your relation AND (1 of your other fields).

Hopefully that will solve your case.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.