What is the hash generation algorithm that Laravel uses?
By default Laravel already comes with a pre-ready authentication system, however, would anyone know to tell me what is the algorithm default that this framework uses to generate hash and what version?
5
1 answers
According to the documentation, for this type of task, the BCryptis used, which goes against a question here about secure passwords. Example:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use App\Http\Controllers\Controller;
class UpdatePasswordController extends Controller {
/**
* Update the password for the user.
*
* @param Request $request
* @return Response
*/
public function update(Request $request) {
// Validate the new password length...
$request->user()->fill([
'password' => Hash::make($request->newPassword)
])->save();
}
}
8
Author: Maniero, 2020-05-05 20:28:05