PHP code example of bella-baxter / laravel

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

    

bella-baxter / laravel example snippets


// In any controller, service, or config file:
$dbUrl = env('DATABASE_URL');         // from Bella Baxter
$apiKey = env('STRIPE_API_KEY');      // from Bella Baxter

use BellaBaxter\Laravel\Facades\Bella;

$secrets = Bella::getAllSecrets();   // array<string, string>
$value   = Bella::getSecret('DATABASE_URL');

use BellaBaxter\BaxterClient;

class MyService
{
    public function __construct(private BaxterClient $bella) {}

    public function doSomething(): void
    {
        $secrets = $this->bella->getAllSecrets();
    }
}

'providers' => [
    // ...
    BellaBaxter\Laravel\BellaServiceProvider::class,
],
'aliases' => [
    // ...
    'Bella' => BellaBaxter\Laravel\Facades\Bella::class,
],

return [
    // ...
    BellaBaxter\Laravel\BellaServiceProvider::class,
];
bash
php artisan vendor:publish --tag=bella-config