I think later, but I found two solutions to solve this problem. First, you can use the bcrypt function if you are using laravel 5.3. Take a look at the function below. This means that you are getting your data in an array.
public function create(array $data)
{
return User::create([
'password' => bcrypt($data['password']),
]);
}
Secondly, you can use the mutator to fix it as follows:
public function setPasswordAttribute($password)
{
$this->attributes['password'] = \Hash::make($password);
}
Hope this can help others. Regards
source
share