PHP code example of impratick / laravel-azure-blob-storage

1. Go to this page and download the library: Download impratick/laravel-azure-blob-storage 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/ */

    

impratick / laravel-azure-blob-storage example snippets


    'azure' => [
        'domain'    => 'https://' . env('AZURE_ACCOUNT_NAME') . '.blob.' . env('AZURE_ENDPOINT_SUFFIX') .
        '/' . env('AZURE_CONTAINER') .
        (env('AZURE_BLOB_FOLDER_NAME') ? '/' . env('AZURE_BLOB_FOLDER_NAME') : ''),
    ],

     /*
     * When urls to files get generated, this class will be called. Leave empty
     * if your files are stored locally above the site root or on s3.
     */
    'url_generator' => (env('MEDIA_DISK', 'public') == 'azure'
        ? Impratick\ExtendedAzureBlobStorage\MediaLibrary\UrlGenerator\AzureBlobUrlGenerator::class
        : null),
 php
    'disks' => [
        'azure' => [
            'driver'          => 'azure',
            'account'         => [
                'name' => env('AZURE_ACCOUNT_NAME'),
                'key'  => env('AZURE_ACCOUNT_KEY'),
            ],
            'endpoint-suffix' => env('AZURE_ENDPOINT_SUFFIX', 'core.windows.net'),
            'container'       => env('AZURE_CONTAINER', 'public'),
            'prefix'          => env('AZURE_BLOB_FOLDER_NAME', null),
        ]
    ]