PHPackages                             martinbean/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. martinbean/eloquent-encryptable

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

martinbean/eloquent-encryptable
===============================

Adds encryptable attributes to Eloquent models, for storing sensitive data.

0.3.0(5y ago)427MITPHP

Since Jan 28Pushed 5y agoCompare

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

READMEChangelogDependencies (4)Versions (4)Used By (0)

Eloquent Encryptable trait
==========================

[](#eloquent-encryptable-trait)

Adds encryptable attributes to Eloquent models, for storing sensitive data, in Laravel 6.x and 7.x applications.

**NOTE:** If you are using Laravel 8.x, you **DO NOT NEED** this package. Laravel offers a native `encrypted` cast that works on strings, collections, and objects. For more information, see [laravel.com/docs/8.x/eloquent-mutators#attribute-casting](https://laravel.com/docs/8.x/eloquent-mutators#attribute-casting)

Usage
-----

[](#usage)

Simply add the trait to your Eloquent model, and define an array of attributes whose values should be encrypted in your database in an `$encryptable` property:

```
