Laravel where and orWhere in query

I have a query with filtering. A lot fields have a where statement, but I also have a multiple select which shoud be orWhere.

My Query looks like this:

$vacancies = Vacancie::select();
if($request->filled('jobs')) {
    $vacancies->whereHas('jobTitle', function ($q) use ($request) {
        foreach($request->jobs as $job) {
            $q->where('id', clean($job));
        }
    });
}
$request->filled('title') ? $vacancies->orWhere('title', 'like', '%' . clean($request->title) . '%') : null;
$request->filled('company') ? $vacancies->orWhere('company', intval($request->company)) : null;
if($request->filled('companyName') || $request->filled('zip') || $request->filled('city')) {
    $companyName = clean($request->companyName);
    $zip = clean($request->zip);
    $city = clean($request->city);
    $vacancies->whereHas('company', function ($q) use ($companyName, $city, $zip) {
        ($city) ? $q->where('city', 'LIKE', '%' . $city . '%') : null;
        ($zip) ? $q->where('zip', 'LIKE', '%' . $zip . '%') : null;
        ($companyName) ? $q->where('title', 'LIKE', '%' . $companyName . '%') : null;
    });
}
$vacancies->get()->toJson();

If I now query for one job, everything works. But if I query for multiple jobs, I get nothing. Thats because I am searching for a vacancie with multiple job relations, but that is a oneToMany relation. If I use orWhere, The filtering doesn't work. How can I achive that I get vacancies from multiple jobs, but the other filter still apply?