2017 © Pedro Peláez
 

library eloquent-encryptable

Adds encryptable attributes to Eloquent models, for storing sensitive data.

image

martinbean/eloquent-encryptable

Adds encryptable attributes to Eloquent models, for storing sensitive data.

  • Saturday, January 28, 2017
  • by martinbean
  • Repository
  • 0 Watchers
  • 2 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Eloquent Encryptable trait

Adds encryptable attributes to Eloquent models, for storing sensitive data, in Laravel 6.x and 7.x applications., (*1)

NOTE: If you are using Laravel 8.x, you DO NOT NEED this package. Laravel offers a native encrypted cast that works on strings, collections, and objects. For more information, see [laravel.com/docs/8.x/eloquent-mutators#attribute-casting][2], (*2)

Usage

Simply add the trait to your Eloquent model, and define an array of attributes whose values should be encrypted in your database in an $encryptable property:, (*3)

<?php

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',
    ];
}

You can retrieve these attributes as normal and they’ll be decrypted:, (*4)

$medical_conditions = $patient->medical_conditions;

License

Licensed under the MIT License., (*5)

Support

Please create an Issue for any problems with this library., (*6)

The Versions

28/01 2017

dev-master

9999999-dev

Adds encryptable attributes to Eloquent models, for storing sensitive data.

  Sources   Download

MIT

The Requires

 

The Development Requires

28/01 2017

0.2.0

0.2.0.0

Adds encryptable attributes to Eloquent models, for storing sensitive data.

  Sources   Download

MIT

The Requires

 

The Development Requires

28/01 2017

0.1.0

0.1.0.0

Adds encryptable attributes to Eloquent models, for storing sensitive data.

  Sources   Download

MIT

The Requires