Just published 29th August 2019 by British Government, for unaccompanied under 18-year-olds travelling from Spain:-
Minors travelling from Spain

From 1 September 2019, Spanish minors and foreign minors resident in Spain under the age of 18 years old may need written authorisation by a parent or legal guardian if a minor is travelling unaccompanied, with a third party or other circumstances. This is in addition to a valid travel document.

British consulates do not provide travel authorisation documents. If a certified authorisation is required, you will need to seek the services of a public notary or other competent authority in Spain. Parents and legal guardians of Spanish minors are also able to obtain a certified authorisation form at a national police station or at the Guardia Civil.