PHP code example of rto-websites / laravel-credentials

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

    

rto-websites / laravel-credentials example snippets


$credential = credentials('api-password');

$credential = credentials('my-production-token', 'my-fallback-value');



return [

    /*
     * Defines the file that will be used to store and retrieve the credentials.
     */
    'file' => config_path('credentials.php.enc'),

    /**
     *
     */
    'editor' => env('CREDENTIALS_EDITOR', 'vi'),

    /*
     * Defines the key that will be used to encrypt / decrypt the credentials.
     * The default is your application key. Be sure to keep this key secret!
     */
    'key' => config('app.key'),

    'cipher' => config('app.cipher'),

];

'editor' => env('CREDENTIALS_EDITOR', 'vi'),
bash
php artisan credentials:edit
bash
php artisan vendor:publish --provider="RtoWebsites\Credentials\CredentialsServiceProvider" --tag="config"