一 : 在config中配置想要加盐的内容
return [
'salt' => 'csdn'
];
二 : 创建控制器
php artisan make:controller Admin\PasswordController
三 : 构造方法
private $salt;
public function __construct()
{
//取出配置
$this->salt = config('Password.salt');
}
四 : 密码加密
/***
* 密码加密
*/
public function encryptPassord($password)
{
//密码为空
if (