pmedynskyi/laravel-encrypt

There is no license information available for the latest version (1.0.0) of this package.

Installs: 517

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 1

pkg:composer/pmedynskyi/laravel-encrypt

1.0.0 2023-09-01 09:02 UTC

This package is auto-updated.

Last update: 2025-09-29 03:07:15 UTC


README

  • Use trait for your models when you want to hash attribute, in the database type of field for the attribute should be TEXT:

  • Example for Model:

use Illuminate\Database\Eloquent\Casts\Attribute;

...implements ...IModelUseEncryptedAttributes{
use ModelUseEncryptedAttributes;
...
    public function attributeOne() :Attribute
    {
        return $this->encryptedAttribute();
    }
...
    public function attributeTwo() :Attribute
    {
        return $this->encryptedAttribute();
    }
...
  • Attribute will automatically been hashed for save/update and uhashed when you will initialize the model