PHP code example of compellio / eloquent-aes

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

    

compellio / eloquent-aes example snippets

bash
php artisan vendor:publish --provider="Compellio\EloquentAES\EloquentAESServiceProvider" --tag="config"
bash
php artisan key:eloquent
 php


namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Compellio\EloquentAES\Casts\AESEncrypted;

class SalesData extends Model
{
    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'private_data' => AESEncrypted::class,
    ];
}