my dog is struggling to eat
When dogs came into our office with appetite, energy issues or just plain age related challenges, we would give them B12 supplementation.
I'm not advising you do since I'm not a vet and a vet would want to diagnose your dog as their patient. This was just an initial option followed by a fecal and routine exam. Balanced B complex and additional B12, (methylcobalamin, sublingual/under the tongue and in the cheeks), was my choice with my own animals.
Beef liver is a good source of B12.
In the office we used injectables.
We would weigh the animal and give the prescribed dosages.
I hope you discover the root cause and solution for your pet.
I will pray for him right now.