eloquent-model-encrypt merge requestshttps://git.customd.com/composer/eloquent-model-encrypt/-/merge_requests2022-12-08T15:28:25+13:00https://git.customd.com/composer/eloquent-model-encrypt/-/merge_requests/14Draft: Feat/cache old attributes2022-12-08T15:28:25+13:00Rick HambrookDraft: Feat/cache old attributesAdding a trait that will allow easy access to non-encrypted from/to (before/after) values after model updates.
The trait: `CacheOldAttributesTrait`
Get changes: `$changes = $model->getUpdatedAttributes();`
Format:
```php
array [
"...Adding a trait that will allow easy access to non-encrypted from/to (before/after) values after model updates.
The trait: `CacheOldAttributesTrait`
Get changes: `$changes = $model->getUpdatedAttributes();`
Format:
```php
array [
"first_name": [
"from": "Jane",
"to": "John"
],
"last_name": [
"from": "Smithe",
"to": "Smith"
],
]
```
All names are WIP and open to change.
### Notes
#### Fuzzy Dirtiness
Currently the trait uses fuzzier checks than standard `getDirty()`. Eg `5` > `5.0` will not be considered dirty. Perhaps this can be configured on a per-attribute basis. This is based off the updated value being cast to the same `type` as the original value on the model. So `false` on the model will match `0` as an updated value.
#### Return Format
Usually the return format is an array keyed by the field name with the values being an array with `from` and `to` values. Passing `true` to the `getUpdatedAttributes()` function will return the sub-array as json encoded for better compatibility with [Spatie Activity Log](https://github.com/spatie/laravel-activitylog).https://git.customd.com/composer/eloquent-model-encrypt/-/merge_requests/13Draft: Resolve "[Feature] - Api token Storage Ability"2022-09-08T09:17:38+12:00Craig SmithDraft: Resolve "[Feature] - Api token Storage Ability"Closes #4
* [ ] migration for pem tokens
* [ ] ability to assign to a Bearer Token
* [ ] ability to assign to a unique key
* [ ] ability to enforce a expiry
* [ ] ability to work with refresh tokens / bearer tokens (passport)Closes #4
* [ ] migration for pem tokens
* [ ] ability to assign to a Bearer Token
* [ ] ability to assign to a unique key
* [ ] ability to enforce a expiry
* [ ] ability to work with refresh tokens / bearer tokens (passport)Craig SmithCraig Smith