This is a bit of a confusing thread. Lets summarize:
- Spells you gain through a class always use the spellcasting attribute of that class. Which is Intelligence for Wizard, Fighter, Rogue; Wisdom for Cleric, Druid, Ranger, Monk; Charisma for Sorcerer, Warlock, Bard, Paladin, Barbarian. This of course also applies if you pick up any of the Magic Initiate feats.
- Barbarian is the only class that never gets spells by itself (Fighter, Rogue, Monk have their respective subclasses) and, if multiclassed, still cannot cast spells or maintain concentration during rage, however for the next point its still important that Charisma is their spellcasting stat.
- If multiclassed, the LAST class picked decides what stat is used IF casting from items or scrolls or using the feats Spell Sniper (Bone Chill, Eldritch Blast, Fire Bolt, Ray of Frost, Shocking Grasp or Thorn Whip) or Warcaster (Shocking Grasp as an Opportunity Attack reaction only). [1]
- The wizard cantrip that High Elf and High Half-Elf can pick always uses Intelligence, which is why Fire Bolt from Shadowheart and Jaheira and to a lesser degree Astarion is most of the time useless in combat, unless you want to merely burn an object, such as an oil surface, or unless you change their class to Wizard and actually push their intelligence, or unless you reserve their helmet slot for the intelligence boost item.
[1]: And I really, really, really wished they would fix that and either pick the highest mental stat one has a class for automatically or allow the player to choose which stat to use, because this arrangement puts quite a penalty on many setups, such as my own favorite multiclass Lore Bard (11) / Knowledge Cleric (1) [of Oghma, the deity of Bards which indeed has Knowledge as domain].