DEV Community

Asep Septiadi
Asep Septiadi

Posted on

Encrypt Password Laravel

return User::create([
    'password' => bcrypt($data['password']),
]);
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
justplayerde profile image
Justin K.

The proper way of hashing a password in laravel would be using the Hash facade:

'password' => Hash::make($data['password'])

Official Documentation: laravel.com/docs/10.x/hashing#hash...

Collapse
 
aspsptyd profile image
Asep Septiadi

Thankyou bro for your insight, this may be can help me to.