PHP code example of dolphiq / laravel-aescrypt

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/ */

    

dolphiq / laravel-aescrypt example snippets


    'providers' => [
        ...
        Dolphiq\Aescrypt\AescryptServiceProvider::class,
    ],

// Aescrypt provider
$app->register(\Dolphiq\Aescrypt\AescryptServiceProvider::class);

    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));

 AESCRYPT_BASE64_OUTPUT = true 

    php artisan vendor:publish --provider='Dolphiq\Aescrypt\AescryptServiceProvider'