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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more