PHP code example of jfelixstudio / aesencrypt

1. Go to this page and download the library: Download jfelixstudio/aesencrypt 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/ */

    

jfelixstudio / aesencrypt example snippets


For laravel 8.x:
$ composer 

'providers' => array(
    JfelixStudio\AESEncrypt\Database\DatabaseServiceProviderEncrypt::class
)

namespace App\Models;

use JfelixStudio\AESEncrypt\Database\Eloquent\ModelEncrypt;

class Person extends ModelEncrypt
{
    /**
     * The attributes that are encrypted.
     *
     * @var array
     */
    protected $fillableEncrypt = [
        'name'
    ];

}

    Schema::create('persons', function (Blueprint $table) {
        // here you do all columns supported by the schema builder
        $table->increments('id')->unsigned;
        $table->string('description', 250);
        $table ->unsignedInteger('created_by')->nullable();
        $table ->unsignedInteger('updated_by')->nullable();
    });

    // once the table is created use a raw query to ALTER it and add the BLOB, MEDIUMBLOB or LONGBLOB
    DB::statement("ALTER TABLE persons ADD name MEDIUMBLOB after id");

APP_AESENCRYPT_KEY=yourencryptedkey
APP_AESENCRYPT_MODE=aes-256-cbc
bash
php artisan vendor:publish --provider="JfelixStudio\AESEncrypt\AesEncryptServiceProvider"