PHP code example of martinbean / eloquent-encryptable

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

    

martinbean / eloquent-encryptable example snippets




namespace App;

use Illuminate\Database\Eloquent\Model;
use MartinBean\Eloquent\Encryptable;

class Patient extends Model
{
    use Encryptable;

    protected $encryptable = [
        'medical_conditions',
        'medical_notes',
        'allergies_and_reactions',
        'medications',
        'blood_type',
        'is_organ_donor',
        'emergency_contact_id',
    ];
}

$medical_conditions = $patient->medical_conditions;