@founderstartup read the docs https://laravel.com/docs/8.x/eloquent-relationships#querying-relationship-existence
assuming you have correct rrelationships between all the models, your queries will be like:
How to show buildings of only enabled cities
Building::whereHas('city', fn ($query) => $query->where('enabled', 1))
How to show builders of only enabled cities (nestead relationships)
Builder::whereHas('building.city', fn ($query) => $query->where('enabled', 1))
and so on