public function scopeFilterByLocationAndDepartment(Builder $query, ?array $locations_id = null, ?array $departments_id = null): Builder 	{ 		return $query->when(!empty($locations_id ?? []), function ($query) use ($locations_id) { 			$query->whereHas('location', function ($query) use ($locations_id) { 				$query->whereIn('id', $locations_id); 			}); 		})->when(!empty($departments_id ?? []), function ($query) use ($departments_id) { 			$query->whereHas('department', function ($query) use ($departments_id) { 				$query->whereIn('id', $departments_id); 			}); 		}); 	}