Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support encrypting content #38

Merged
merged 8 commits into from
Feb 20, 2024
Merged

Support encrypting content #38

merged 8 commits into from
Feb 20, 2024

Conversation

tonysm
Copy link
Owner

@tonysm tonysm commented Feb 19, 2024

Added

  • Introduces a new options API to rich text attributes, which allows us to set some of them as encrypted

closes #34


This PR allows passing the encrypted options to any rich text fields to ensure they are encrypted at rest. It should allow encryption on a per-field basis. Since we may have multiple fields on the same model (record), this will allow us to encrypt only the ones we want to.

Example usage:

use Illuminate\Database\Eloquent\Model;
use Tonysm\RichTextLaravel\Models\Traits\HasRichText;

class Message extends Model
{
    use HasRichText;

    protected $richTextAttributes = [
        'content' => ['encrypted' => true],
        'notes', // Not encrypted...
    ];
}

@tonysm tonysm merged commit dbd11ba into main Feb 20, 2024
9 checks passed
@tonysm tonysm deleted the tm/encrypted-rich-texts branch February 20, 2024 00:57
@tonysm
Copy link
Owner Author

tonysm commented Feb 20, 2024

Merged this. But if anyone has anything against it or any other API suggestion, feel free to comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Encryption
1 participant