[5.3] Offer an "Attribute Casting" of encrypt#16443
[5.3] Offer an "Attribute Casting" of encrypt#16443taylorotwell merged 3 commits intolaravel:5.3from alnutile:patch-1
Conversation
This would allow the user to easily encrypt and decrypt a field by setting it to that `cast`
For example
```
protected $casts = [
'secret' => 'encrypt',
'data' => 'array'
];
```
|
Should I go update the docs? @taylorotwell |
|
Awesome , I had written this as a trait numerous times ~ |
|
:) |
|
Should this be a "cast"? I've written something similar into my models but using a separate My use case is storing OAuth tokens. I store the access token, refresh token, and expiration in an array and assign it to an attribute with the Edit: To address my use case, I've created #16457 to change this functionality. |
This would allow the user to easily encrypt and decrypt a field by setting it to that
castFor example