PHPackages                             dtisgodsson/elocrypt - 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. dtisgodsson/elocrypt

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

dtisgodsson/elocrypt
====================

Automatically encrypt and decrypt Eloquent attributes with ease.

v1.6(10y ago)51.1k↓50%2PHPPHP &gt;=5.4.0

Since Sep 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/dtisgodsson/elocrypt)[ Packagist](https://packagist.org/packages/dtisgodsson/elocrypt)[ RSS](/packages/dtisgodsson-elocrypt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

Eloquent Encryption/Decryption for Laravel 4
============================================

[](#eloquent-encryptiondecryption-for-laravel-4)

Installation
============

[](#installation)

This package can be installed via Composer by adding the following to your composer.json file:

```
"require": {
	"dtisgodsson/elocrypt": "1.*"
}

```

You must then run the following command:

```
composer update

```

Usage
=====

[](#usage)

Simply reference the ElocryptTrait in any Eloquent Model you wish to apply encryption to and then define an "encryptable" array on that model containing a list of the attributes you wish to Encrypt.

For example:

```
class User extends Eloquent {

		use ElocryptTrait;

		public $encryptable = ['first_name', 'last_name', 'address_line_1', 'postcode'];
}

```

How it Works?
=============

[](#how-it-works)

By including the ElocryptTrait, the \_\_set() and \_\_get() methods provided by Eloquent are overridden to include an additional step. This additional step simply checks whether the attribute being set or get is included in the "encryptable" array on the model, and either encrypts/decrypts it accordingly OR calls the parent \_\_set() or \_\_get() method.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 70% 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 ~37 days

Recently: every ~55 days

Total

7

Last Release

3686d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/274aa39196308442db67027424d34f4370a50fe0fa6561c644c1ff3d5fc236c1?d=identicon)[dtisgodsson](/maintainers/dtisgodsson)

---

Top Contributors

[![darrentaytay](https://avatars.githubusercontent.com/u/724786?v=4)](https://github.com/darrentaytay "darrentaytay (14 commits)")[![s3rajkarnikar](https://avatars.githubusercontent.com/u/2102892?v=4)](https://github.com/s3rajkarnikar "s3rajkarnikar (6 commits)")

---

Tags

laravelencryptioneloquentencryptlaravel4L4eloquent encryptionlaravel4 encryptionlaravel4 aeseloquent aeselocrypt

### Embed Badge

![Health badge](/badges/dtisgodsson-elocrypt/health.svg)

```
[![Health](https://phpackages.com/badges/dtisgodsson-elocrypt/health.svg)](https://phpackages.com/packages/dtisgodsson-elocrypt)
```

###  Alternatives

[delatbabel/elocryptfive

Automatically encrypt and decrypt Eloquent attributes with ease.

8493.0k](/packages/delatbabel-elocryptfive)[dolphiq/laravel-aescrypt

AES encrypt and decrypt Eloquent attributes inspired by elocryptfive

171.7k](/packages/dolphiq-laravel-aescrypt)[betterapp/laravel-db-encrypter

Provides database model attribute encryption/decryption

365614.7k8](/packages/betterapp-laravel-db-encrypter)[rutorika/sortable

Adds sortable behavior and ordering to Laravel Eloquent models. Grouping and many to many supported.

299992.5k14](/packages/rutorika-sortable)[sjdaws/vocal

Recursive functionality for Eloquent in Laravel 4 and 5

4315.2k1](/packages/sjdaws-vocal)

PHPackages © 2026

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