You have to use eloquent join method
$departments = Department::select('departments.*')
->join('department_categories', 'department_categories.department_id', '=', 'departments.id')
->join('department_tags', 'deparment_tags.department_id', '=', 'departments.id')
->where('department_categories.categorie_type_id', '=', $category_type_id)
->where('department_tags.tag_type_id', '=', $tag_type_id)
->get();
Thanks so far so good. How does it look if i have plenty tags? In this solution i can only ask for one.
$query->whereIn('department_tags.tag_type_id', $tag_ids_array);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community