Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

Encrypt/decrypt attributes with casts or model property #1244

@barryvdh

Description

@barryvdh

To make it easier to encrypt/decrypt columns in the database, it could be built-in to the Eloquent model, similar to either the $dates attribute or the $casts properties.
Using an extra property would allow for being cast to a type after decrypting, so perhaps better.

To make it easy for users to encrypt existing data, a command could be added to encrypt data based on these columns. (eg. php artisan db:encrypt --class="App\User")

It could be done using mutators/accessors, but having this built-in could make it easier and cache objects to avoid multiple times decrypting the same value in the same request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions