datalogix / laravel-hash-fields
Laravel Hash Fields automatically hash model fields.
Installs: 235
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 1
pkg:composer/datalogix/laravel-hash-fields
Requires
- php: ^7.3|^8.0
- illuminate/support: ^7.0|^8.0|^9.0
Requires (Dev)
- graham-campbell/testbench: ^5.7
- illuminate/database: ^7.0|^8.0|^9.0
- mockery/mockery: ^1.4
- phpunit/phpunit: ^8.5|^9.5
- spatie/phpunit-watcher: ^1.0
README
Warning We have decided to stop maintaining this package.
Consider to use Attribute Casting of type
hashed.
Laravel Hash Fields automatically hash model fields.
Installation
You can install the package via composer:
composer require datalogix/laravel-hash-fields
The package will automatically register itself.
Usage
Your Eloquent models should use the Datalogix\HashFields\HashFields trait.
Here's an example of how to implement the trait:
namespace App; use Datalogix\HashFields\HashFields; use Illuminate\Database\Eloquent\Model; class YourEloquentModel extends Model { use HashFields; }
Customizing fields to hash
You can also override of property fieldsToHash.
By default the package will hashed password field.
/** * The model's fields to hash. * * @var array */ protected static $fieldsToHash = [ 'password', ];