  We explore the possibility that lepton family numbers and baryon number are
such good symmetries of Nature because they are the global remnant of a
spontaneously broken gauge symmetry. An almost arbitrary linear combination of
these symmetries (together with a component of global hypercharge) can be
consistently gauged, if the Standard Model (SM) fermion content is augmented by
three chiral SM singlet states. Within this framework of $U(1)$ extensions of
the SM one generically expects flavour non-universality to emerge in the
charged leptons, in such a way that naturally prevents lepton flavour
violation, by aligning the mass and weak eigenbases. For quarks, all the SM
Yukawa couplings responsible for their observed masses and mixings arise at the
renormalisable level. We perform fits to show that models in this class can
explain $R_{K^{(\ast)}}$ and the other neutral current $B$ anomaly data if we
introduce a heavy vector-like quark to mediate the required quark flavour
violation, while simultaneously satisfying other constraints from direct
$Z^\prime$ searches at the LHC, $B_s$ meson mixing, a number of electroweak
precision observables, and neutrino trident production. Within this
symmetry-motivated framework of models, we find interesting implications for
the flavour anomalies; notably, any axial couplings of the $Z^\prime$ to
electrons and muons must be flavour universal, with the flavour universality
violation arising solely from the vector-like couplings. We also comment on the
generation of neutrino masses in these models.
