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

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogobbosouza committed Oct 19, 2021
1 parent 5e3a610 commit 8e0ceb4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,36 @@ 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:

```php
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.

```php
/**
* The model's fields to hash.
*
* @var array
*/
protected static $fieldsToHash = [
'password',
];
```

0 comments on commit 8e0ceb4

Please sign in to comment.