venturedrake / laravel-encryptable
Automatically encrypt and decrypt database table fields
Fund package maintenance!
venturedrake
Installs: 7 535
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^7.2|^8.0
- illuminate/contracts: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0|^6.0|^7.0|^8.0|^9.0
- phpunit/phpunit: ^8.0|^9.0
This package is auto-updated.
Last update: 2024-11-03 14:24:48 UTC
README
Automatically encrypt and decrypt database table fields.
Installation
You can install the package via composer:
composer require venturedrake/laravel-encryptable
You can publish the config file with:
php artisan vendor:publish --provider="VentureDrake\LaravelEncryptable\LaravelEncryptableServiceProvider" --tag="config"
Usage
Add the trait to your model and your encryptable rules.
<?php namespace App; use Illuminate\Database\Eloquent\Model; use VentureDrake\LaravelEncryptable\Traits\LaravelEncryptableTrait; class Person extends Model { use LaravelEncryptableTrait; /** * Laravel Encryptable Rules * * @var array */ protected $encryptable = [ 'first_name', 'last_name', ]; ... }
Now when you store, update or read from the model the first_name and last_name fields will automatically be encrypted and decrypted.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.