Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,8 @@ function __construct() {
};
}
```

<a name="uniquerules"></a>
## Updates with Unique Rules
<a name="secure"></a>
## Automatically Transform Secure-Text Attributes

Suppose you have an attribute named `password` in your model class, but don't want to store the plain-text version in the database. The pragmatic thing to do would be to store the hash of the original content. Worry not, Ardent is fully capable of transmogrifying any number of secure fields automatically for you!

Expand All @@ -375,9 +374,9 @@ class User extends \LaravelBook\Ardent\Ardent {

Ardent will automatically replace the plain-text password attribute with secure hash checksum and save it to database. It uses the Laravel `Hash::make()` method internally to generate hash.

<a name="uniquerules"></a>
## Updates with Unique Rules

<a name="secure"></a>
## Automatically Transform Secure-Text Attributes
Ardent can assist you with unique updates. According to the Lavavel Documentation, when you update (and therefore validate) a field with a unique rule, you have to pass in the unique ID of the record you are updating. Without passing this ID, validation will fail because Laravel's Validator will think this record is a duplicate.

From the Laravel Documentation:
Expand Down