I used Neem oil diluted in water last year to treat fungus gnats in my plants. I sprayed it on the leaves and also soaked the plants in a bucket of water containing Neem oil. It worked the first time and killed a heap of fungus gnats but didn't do anything after that and the gnats continued breeding and feeding on the roots of the plants a couple of weeks after the first treatment.
The instructions say not to use it on food crops. The hardware I bought it from said it was fine on blueberries and strawberries. I contacted various nurseries and was told it was extremely toxic to anything ingesting the leaves, fruits or flowers because the Neem oil is absorbed into the leaves and taken up by the roots. Any sap sucking insects that feed on the plant are meant to die.
As mentioned, the first treatment worked but the second and third treatments (applied 2 and 4 weeks later) didn't do anything to the gnats. I contacted the manufacturer and they said it was toxic in plants for several weeks after the plant was sprayed or watered with the Neem Oil solution. The guy I spoke to said he would eat strawberries off the plant 2 weeks after using Neem oil on the plants.
I erred on the side of caution because I have been poisoned several times before and put the plants outside and left them there. I have not eaten anything from them. Theoretically the plants should have removed the Neem oil from their system after a month or two because the insects get stuck into the plants a few weeks after spraying. This would suggest there is no longer any (or enough) active chemical in the plant to kill the insects.
If I had to eat the plants or parts of them, or feed them to pets, I would wait at least 1 month after spraying before ingesting any of the sprayed material. And I would wash the plant matter thoroughly before eating it.
Aphids can be controlled by making up some soapy water and lathering it up on the leaves or flowers where the aphids are. I used to squirt some washing up liquid into half a bucket of water and make it foamy, then pick it up in my hands and wipe it over the aphids. Don't do this if it's hot because it can burn the leaves, same with the Neem oil, do it at night or when it's cooler (anything over 90F (32C) can cause problems.
You can also buy lady bugs online and release them around the plants. They eat aphids. If you have fish, you can tap the aphids into a plastic bucket and feed them to the fish or freeze them for use later on. Having lots of different flowers can encourage predatory insects into your vege patch to help control pest insects.