1. Go to this page and download the library: Download redsd/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/ */
namespace App\Models;
use redsd\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)->nullable();
$table->timestamps();
});
// 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");