Hey @luceos, with your suggestion I have successfully implemented this extension (code). Please correct me if I did anything wrong.
Now although the current code works fine, I'm curious in one question. Since the Flarum core also calls User::setHasher() under the CoreServiceProvider, how can I make sure that the service provider I write would be evaluated after the core service provider? Also imagine that in some scenarios, two extensions both register a service provider that may be conflicting with each other, then what determines the order of their evaluations?
Thanks!