1. Go to this page and download the library: Download dolphiq/laravel-aescrypt library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Dolphiq\Aescrypt\Aescrypt;
class User extends Eloquent {
use Aescrypt;
/**
* The attributes that should be encrypted on save.
*
* @var array
*/
protected $encrypts = [
'username', 'email'
];
}
set @salt = SUBSTRING(SHA2('My secret pass phrase',256), 1, 16);
SELECT @salt as salt, TO_BASE64(AES_ENCRYPT('text to encrypt', @salt));