here is my database data design title description skills[]
and request data is tags array which I wanna check with database skills if tags like database skills then return all jobs
$companyTags = CompanyJobTag::where('company_id', $company->id)->get();
$query = EmployerJob::with('user');
$tags = [];
foreach ($companyTags as $key => $tag) {
array_push($tags, $tag->tag);
}
$query->where(function($q) use($tags){
for ($i=0; $i < count($tags); $i++) {
$q->orWhere('title', 'LIKE', "%{$tags[$i]}%");
}
});
$jobs = $query->orderByDesc('created_at')
->paginate(10);
return response()->json($jobs, 200);
here I can check employer job with companytags array, but empoyerjob also contains jobs skills array so how I can get only that jobs which match with company tags array