PHPackages                             thomascombe/encryptable-fields - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. thomascombe/encryptable-fields

Abandoned → [webqamdev/encryptable-fields](/?search=webqamdev%2Fencryptable-fields)Library

thomascombe/encryptable-fields
==============================

Laravel Backpack Fields Encryptable

1.2.0(6y ago)51.1k2[1 issues](https://github.com/webqamdev/laravel-encryptable-fields/issues)[1 PRs](https://github.com/webqamdev/laravel-encryptable-fields/pulls)MITPHPPHP ^7.1

Since Aug 31Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/webqamdev/laravel-encryptable-fields)[ Packagist](https://packagist.org/packages/thomascombe/encryptable-fields)[ Docs](https://github.com/webqamdev/encryptable-fields)[ RSS](/packages/thomascombe-encryptable-fields/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (10)Used By (0)

Eloquent model encrypted fields for Laravel
===========================================

[](#eloquent-model-encrypted-fields-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f05119773d15271e460953aa783dbf1eb83ce27893f0e4d01e32964b2435030f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77656271616d6465762f656e637279707461626c652d6669656c64732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webqamdev/encryptable-fields)[![Total Downloads](https://camo.githubusercontent.com/3fa098165592a25319852c0c857bca7c9af773f108f2e8fda44e74706a24f96a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77656271616d6465762f656e637279707461626c652d6669656c64732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/webqamdev/encryptable-fields)

Allow you to encrypt model's fields. You can add a hashed field to allow SQL query.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require webqamdev/encryptable-fields
```

You can publish the configuration via Artisan:

```
php artisan vendor:publish --provider="Webqamdev\EncryptableFields\EncryptableFieldsServiceProvider"
```

Usage
-----

[](#usage)

To work with this package, you need to use our `EncryptableFields` trait in your models, then override the `$encryptable` property. This array allows you to define encryptable attributes in your model.

You can also add attributes to contain a hash of the non encrypted value, which might be useful in order to execute a fast full match for a given searched value.

To do so, you need to use the `$encryptable` property as an associative array, where encryptable attributes are keys and associated hashed attributes are values.

```
