【发布时间】:2016-03-31 01:34:40
【问题描述】:
我已经做了一个php class that combines different hash algorithms,我想在bcrypt() laravel 的方法中实现它。
我目前的解决方案是访问 AuthController 并将 bcrypt($data['password']) 替换为 bcrypt(phashp($data['password'])),但我想知道是否有一种方法可以在不更改 Illuminate Hashing 供应商或 AuthController 中的代码的情况下修改方法。
如何扩展此方法?
谢谢!
【问题讨论】:
-
您可以将自己的“散列器”绑定到容器作为“散列”。 bcypt 帮助程序从容器中解析“哈希”并在其上调用
->make($value, $options)。
标签: php laravel hash illuminate-container laravel-5.2