标签: laravel variables hash passwords
$user = User::create(request(['name', 'email', 'password']));
在上面的代码中,我需要用什么语法来替换带有自定义$ password变量的request() - >密码变量?
答案 0 :(得分:1)
最快的方法是:
$vars = request(['name','email']); $vars['password'] = $password; $user = User::create($vars);