DEV Community

Encrypt Password Laravel

Asep Septiadi on November 10, 2023

return User::create([ 'password' => bcrypt($data['password']), ]); Enter fullscreen mode Exit fullscreen mode
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.