PHP code example of osw3 / symfony-entity-encrypt
1. Go to this page and download the library: Download osw3/symfony-entity-encrypt library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
osw3 / symfony-entity-encrypt example snippets
// config/bundles.php
return [
// ...
OSW3\EntityEncrypt\EntityEncryptBundle::class => ['all' => true],
];
use OSW3\EntityEncrypt\Attribute\Encrypted;
class Message
{
// ...
#[ORM\Column(type: Types::TEXT)]
#[Encrypted] // Just add this Attribute
#[Encrypted(salt: 'my-salt')] // or add this Attribute with salt
private ?string $secret = null;
// ...
}