I once motorized a cargo bike for my mother (unfortunately, she didn't start using it, but we sold it and the next person likely did).
I considered a motor on the pedal hub, but found it many times easier to install a direct-drive motor in the front fork (assuming the fork is steel - aluminum forks may be unsafe to use with powerful motors, or you need a steel "torque arm" to avoid ruining the fork).