Skip to content

Instantly share code, notes, and snippets.

@beisong7
Last active June 25, 2020 12:49
Show Gist options
  • Save beisong7/6956c0940f1fccd4a91a8ca85d2945e7 to your computer and use it in GitHub Desktop.
Save beisong7/6956c0940f1fccd4a91a8ca85d2945e7 to your computer and use it in GitHub Desktop.
Encryption with Laravel
<?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