In this example we will see how to encrypt and decrypt string in laravel 8 using crypt helper, As we all know laravel framework provide more security to user and that's why laravel provide encrypt of password or string to user, here we will see how to encrypt or decrypt string in laravel.
You need to use Crypt class to start encryptString and decryptString or some data.
use Crypt;
use App\Model\User;
$user = new User();
$user->password = Crypt::encrypt($data['password']);
$user->save();
public function encrypt()
{
$encrypted = Crypt::encryptString('websolutionstuff');
print_r($encrypted);
}
public function decrypt()
{
$decrypt= Crypt::decryptString('your_encrypted_string');
print_r($decrypt);
}
$data = Request::all();
$user = new User();
$user->password = Crypt::encrypt($data['password']);
$user->save();
foreach ($user as $row)
{
Crypt::decrypt($row->password);
}
In this article, we will see laravel 9 autocomplete search from the database. Using ajax autocomplete textbox in la...
Mar-14-2022
In this article, we will see laravel 9 authentication using inertia js. Here, you can learn how to authenticat...
Dec-05-2022
In this post we will see Laravel 8 qr code generate example. we will generate QR Code using simple-qrcode package....
Jun-30-2021
In this article, we will see laravel 9 generate PDF from HTML using TCPDF. Here, we will learn how to integrate tcpdf in...
Jan-31-2023