PHP code example of eznix86 / laravel-litestream

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

    

eznix86 / laravel-litestream example snippets


'socket' => [
    'enabled' => true,
    'path' => env('LITESTREAM_SOCKET_PATH'),
    'permissions' => env('LITESTREAM_SOCKET_PERMISSIONS', 0o600),
],

'replicas' => [
    's3' => [
        'type' => 's3',
        'bucket' => env('LITESTREAM_S3_BUCKET'),
        'path' => env('LITESTREAM_S3_PATH'),
        'access_key_id' => env('LITESTREAM_ACCESS_KEY_ID'),
        'secret_access_key' => env('LITESTREAM_SECRET_ACCESS_KEY'),
        'custom_options' => [
            'force_path_style' => true,
        ],
    ],
],

use Eznix86\Litestream\Facades\Litestream;

Litestream::resolveConnectionsUsing(function (array $connections): array {
    return array_merge($connections, [
        'analytics' => [
            'name' => 'analytics',
            'replicas' => ['s3'],
            'path_mode' => 'append',
        ],
    ]);
});

Litestream::forgetConnectionResolver();
bash
php artisan vendor:publish --tag=litestream-config
bash
php artisan litestream:install
bash
php artisan litestream:replicate
bash
php artisan litestream:status
php artisan litestream:reset
php artisan litestream:restore
php artisan litestream:sync