PHP code example of ibrostudio / laravel-multenv

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

    

ibrostudio / laravel-multenv example snippets


return [
    '.env.primary' => ['encrypt' => true],
    '.env.custom' => ['encrypt' => false],
];

'.env.primary' => ['encrypt' => true]

return [
    '.env.primary' => ['encrypt' => true, 'pattern' => 'branch-*'],
    '.env.custom' => ['encrypt' => false],
];
bash
php artisan vendor:publish --tag="multenv-config"
bash
php artisan multenv:merge
bash
php artisan multenv:key
bash
php artisan multenv:encrypt
bash
php artisan multenv:decrypt
bash
#!/bin/sh

echo "---- PRE PUSH ----"
php artisan multenv:encrypt
git add .env.*.encrypted
git commit -m 'Auto embed encrypted env files'
echo "--- PRE PUSH END ---"
bash
#!/bin/sh

echo "---- POST MERGE ----"
php artisan multenv:decrypt
php artisan multenv:merge
echo "--- POST MERGE END ---"