IT & Programming

Encrypt and Decrypt a string with Laravel

Laravel offers built in functions to encrypt or decrypt a string or text. See the example below:

use Illuminate\Support\Facades\Crypt;

$encrypted = Crypt::encryptString('Belgium');

$decrypted = Crypt::decryptString($encrypted);

Leave A comment

Email address is optional and will not be published. Only add email address if you want a reply from blog author.
Please fill required fields marked with *