jetiradoro/laravel-encrypt-model

Encrypt data before insert database

Installs: 16

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:laravel-package

pkg:composer/jetiradoro/laravel-encrypt-model

1.0 2019-02-01 12:09 UTC

This package is auto-updated.

Last update: 2025-09-29 02:42:16 UTC


README

This component allows you encrypt data before insert in database, and auto decrypt when you get the attribute

Installation

  1. With Composer : download files
composer require jetiradoro/laravel-encrypt-model
  1. In your model you need use Encryptable Trait and define $encryptable array with fields which you want encrypt.
  • Example
class User extends Model
{
    use Encryptable;

    protected $encryptable = [
        'cc',
        'ss',
        'phone',
    ];
}
...

This component has been inspired in https://laracasts.com/discuss/channels/laravel/encrypting-model-data article