Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Laravel Hash Fields automatically hash ​model fields.

License

Notifications You must be signed in to change notification settings

datalogix/laravel-hash-fields

Repository files navigation

Laravel Hash Fields

Warning We have decided to stop maintaining this package.

Consider to use Attribute Casting of type hashed.

Latest Stable Version Total Downloads tests StyleCI codecov License

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',
];

About

Laravel Hash Fields automatically hash ​model fields.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages