PHP code example of tobymaxham / laravel-envcrypter

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

    

tobymaxham / laravel-envcrypter example snippets


$crypter = new \TobyMaxham\LaravelEnvCrypter\EnvCrypter('Your-Secret-Token');

$content = $crypter->encryptFile('.env'); // encrypt the .env-File
file_put_contents('.env.repository', $content);

$crypter = new \TobyMaxham\LaravelEnvCrypter\EnvCrypter('Your-Secret-Token');

$content = $crypter->decryptFile('.env.repository'); // decrypt the file
file_put_contents('.env', $content); // update your local file