laravel import hash code example
Example 1: laravel hash
use Illuminate\Support\Facades\Hash;
Hash::make($newPassword);
if (Hash::check('plain-text', $hashedPassword)) {
}
Example 2: import hash laravel
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
class PasswordController extends Controller
{
public function update(Request $request)
{
$request->user()->fill([
'password' => Hash::make($request->newPassword)
])->save();
}
}
Example 3: laravel hash
use Illuminate\Support\Facades\Hash;