Last active
June 25, 2020 12:49
-
-
Save beisong7/6956c0940f1fccd4a91a8ca85d2945e7 to your computer and use it in GitHub Desktop.
Encryption with Laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\Illuminate\Encryption\Encrypter; | |
$key = 'password12345678'; | |
$encrypter = new Encrypter($key); | |
$payload = ['username'=>'admin', 'password'=>'password']; | |
$encryption = $encrypter->encrypt($payload); | |
echo $encryption . '<br>'; | |
$data = $encrypter->decrypt($encryption); | |
echo $data; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment