我的代码中发生了 ErrorException $user->password = Hash::make(Input::get('password')); 说password_hash():密码必须是字符串。我正在使用 laravel 框架
$user = new User();
$user->username = Input::get('username');
$user->password = Hash::make(Input::get('password'));
if($user->save())
{
return Redirect::route('home')->with('success','You register successfully. You can now login');
} else {
return Redirect::route('home')->with('fail','An error occurred while creating user. Please try again.');
}