Populate flat array from a nested array with dynamic keys from Laravel post model
I'd like to use DeepL to translate my Laravel Post model. The problem is, their API requires that we submit a flat array of translations. E.g. our payload would be - { "target_lang": "ES", "text": [ "The post title", "A…