PHP code example of involix / elocryptfive

1. Go to this page and download the library: Download involix/elocryptfive 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/ */

    

involix / elocryptfive example snippets


    'providers' => [
        ...
        Involix\Elocrypt\ElocryptServiceProvider::class,
    ],

    return [
        'prefix' => env('ELOCRYPT_PREFIX', '__This_is_encrypted_data__')
    ]

    use Delatbabel\Elocrypt\Elocrypt;

    class User extends Eloquent {

        use Elocrypt;
       
        /**
         * The attributes that should be encrypted on save.
         *
         * @var array
         */
        protected $encrypts = [
            'address_line_1', 'first_name', 'last_name', 'postcode'
        ];
    }

    use Delatbabel\Elocrypt\Elocrypt;

    class User extends Eloquent {

        use Elocrypt;

        protected $casts = ['extended_data' => 'array'];

        protected $encrypts = ['extended_data'];
    }

    'key' => env('APP_KEY', 'SomeRandomString'),

    'cipher' => 'AES-256-CBC',

    $user = new User();
    $encryptedEmail = $user->encryptedAttribute(Input::get("email"));

    $auth = Auth::attempt(array(
                "email"     =>  Input::get("email"),
                "password"  =>  Input::get("password"),
    ), $remember);

    php artisan vendor:publish --provider='Involix\Elocrypt\ElocryptServiceProvider'