submtd / laravel-encrypted-fields
Provides a trait that allows for encrypted fields on an Eloquent model
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Package info
github.com/submtd/laravel-encrypted-fields
pkg:composer/submtd/laravel-encrypted-fields
Requires
- php: >=5.3
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-07-09 02:28:37 UTC
README
Provides a trait that allows for encrypted fields on an Eloquent model
Installation
composer require submtd/laravel-encrypted-fields
Usage
Add the HasEncryptedFields trait to your model class, and add a protected property called $encrypted containing an array of fields that should be encrypted.
<?php
use Illuminate\Database\Eloquent\Model;
use Submtd\LaravelCustomLog\HasEncryptedFields;
class Person extends Model
{
use HasEncryptedFields;
protected $encrypted = [
'social_security_number',
];
}