PHP code example of brandoriented / doctrine-encryption-bundle

1. Go to this page and download the library: Download brandoriented/doctrine-encryption-bundle 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/ */

    

brandoriented / doctrine-encryption-bundle example snippets


   app/AppKernel.php
   
   
    public function registerBundles()
    {
        $bundles = [
            ...
            new BrandOriented\Encryption\DoctrineEncryptionBundle(),
            ...
        ];
    }

use BrandOriented\Encryption\Bridge\Bridge;

$this->get(Bridge::class)->encrypt($string)
$this->get(Bridge::class)->decrypt($string);

    use BrandOriented\Encryption\Annotation\Encrypted;

    class User {
       /**
       * @Encrypted()
       */
       private $firstname;
    
    }
twig
{{ user.firstname | decrypt }}