PHPackages                             kduma/eloquent-encryptable - 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. [Database &amp; ORM](/categories/database)
4. /
5. kduma/eloquent-encryptable

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

kduma/eloquent-encryptable
==========================

Adds possibility to encrypt fields in Laravel Eloquent models.

v1.3.0(1y ago)62.1k[1 issues](https://github.com/kduma-OSS/LV-eloquent-encryptable/issues)MITPHPPHP &gt;=7.4

Since Jan 31Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/kduma-OSS/LV-eloquent-encryptable)[ Packagist](https://packagist.org/packages/kduma/eloquent-encryptable)[ RSS](/packages/kduma-eloquent-encryptable/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (1)Versions (11)Used By (0)

Package EOL
===========

[](#package-eol)

> **This package is deprecated and no longer maintained.**
>
> Since Laravel 8, the framework includes built-in [encrypted casts](https://laravel.com/docs/eloquent-mutators#encrypted-casting) which provide the same functionality natively:
>
> ```
> protected $casts = [
>     'secret_field' => 'encrypted',
>     'secret_array' => 'encrypted:array',
> ];
> ```
>
>
>
> The built-in solution offers better type support, integration with the cast system, and is actively maintained as part of the framework. Please migrate to native encrypted casts.

---

L5-eloquent-encryptable
=======================

[](#l5-eloquent-encryptable)

[![Latest Stable Version](https://camo.githubusercontent.com/edb53814cbec5fe67bc10d6c011d490f3977f65c78cb66717a2dd1371b73cd0b/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d656e637279707461626c652f762f737461626c652e737667)](https://packagist.org/packages/kduma/eloquent-encryptable)[![Total Downloads](https://camo.githubusercontent.com/daf30e5e95f0d99757f09e5fa0403f2bdd724a6a7b00b742dd50aeee397fc939/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d656e637279707461626c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/kduma/eloquent-encryptable)[![Latest Unstable Version](https://camo.githubusercontent.com/1a5494c0293a2660edc8599f63f78adbf0f7cfd7cfa19f7e34f5c06973daaa28/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d656e637279707461626c652f762f756e737461626c652e737667)](https://packagist.org/packages/kduma/eloquent-encryptable)[![License](https://camo.githubusercontent.com/3f44f8c19ad9a2e006021709aff0fd4c2e1119a7016ba3cc90ae303fd3eea2e1/68747470733a2f2f706f7365722e707567782e6f72672f6b64756d612f656c6f7175656e742d656e637279707461626c652f6c6963656e73652e737667)](https://packagist.org/packages/kduma/eloquent-encryptable)[![SensioLabsInsight](https://camo.githubusercontent.com/68c12c189847da8567c22ae4d85ebec21b018cf0d571e679371c2592392f3564/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62323439376666632d663537352d346562302d623034612d3233303732633534613535322f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b2497ffc-f575-4eb0-b04a-23072c54a552)[![StyleCI](https://camo.githubusercontent.com/91dca32a101c5e53a75791706937a20c20b26f79b1fc8b362bccc026a390149d/68747470733a2f2f7374796c6563692e696f2f7265706f732f33303130323935382f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/30102958)

Adds possibility to encrypt fields in Laravel Eloquent models.

Check full documentation here: [opensource.duma.sh/libraries/deprecated/eloquent-encryptable](https://opensource.duma.sh/libraries/deprecated/eloquent-encryptable)

Setup
=====

[](#setup)

Add the package to the require section of your composer.json and run `composer update`

```
"kduma/eloquent-encryptable": "^1.1"

```

Prepare models
==============

[](#prepare-models)

In your model add following lines:

```
use \KDuma\Eloquent\Encryptable;
protected $encrypted=['list', 'of', 'fields', 'you', 'wan\'t', 'to', 'encrypt'];

```

Usage
=====

[](#usage)

It will be automaticly encrypting and decrypting fields defined in `$encrypted` property of your model.

Those fields must be `string` or `text` for longer values.

YOTTARAM
========

[](#yottaram)

A special thanks to [Jonathan Stavis](http://yottaram.com/blog/2014/10/24/encrypting-eloquent-models/), an original code creator that this package is based on.

Packagist
=========

[](#packagist)

View this package on Packagist.org: [kduma/eloquent-encryptable](https://packagist.org/packages/kduma/eloquent-encryptable)

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance59

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 91.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~446 days

Recently: every ~860 days

Total

9

Last Release

600d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4.0

v1.1.2PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/d09451622719c7efce1a7971b8e5a875859504882ba2b8c279d1015a99e8f12c?d=identicon)[kduma](/maintainers/kduma)

---

Top Contributors

[![kduma](https://avatars.githubusercontent.com/u/1062582?v=4)](https://github.com/kduma "kduma (31 commits)")[![lukepolo](https://avatars.githubusercontent.com/u/2066668?v=4)](https://github.com/lukepolo "lukepolo (3 commits)")

---

Tags

laravelphplaraveleloquentencryptencodecrypt

### Embed Badge

![Health badge](/badges/kduma-eloquent-encryptable/health.svg)

```
[![Health](https://phpackages.com/badges/kduma-eloquent-encryptable/health.svg)](https://phpackages.com/packages/kduma-eloquent-encryptable)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[spatie/laravel-sluggable

Generate slugs when saving Eloquent models

1.6k12.9M311](/packages/spatie-laravel-sluggable)[watson/validating

Eloquent model validating trait.

9803.5M54](/packages/watson-validating)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k332.0k1](/packages/cybercog-laravel-love)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
