Azure-OSS / azure-storage-php-adapter-laravel

Azure Storage Blob filesystem driver for Laravel
MIT License
14 stars 4 forks source link

Package not putting files separately in Azure storage container for each tenant #3

Open hamees-allshore opened 3 hours ago

hamees-allshore commented 3 hours ago

I have installed this package in a web application that is running of Azure with Azure Storage containers. The app is storing all files on the root of the container while it should have created a separate folder for each tenant and then have placed files in them.

I have configured everything correctly but seems that the storage adapter is not considering the suffix parameter set by the multi-tenancy for laravel package.

config/filesystems.php

// ...
'azure' => [
            'driver' => 'azure-storage-blob',
            'connection_string' => env('AZURE_STORAGE_CONNECTION_STRING'),
            'container' => env('AZURE_STORAGE_CONTAINER'),
        ],
// ...

config/tenancy.php

// ...
'filesystem' => [
        'suffix_base' => 'tenant',
        'disks' => [
            'local',
            'public',
            'azure',
        ],
// ...

Reference: #https://tenancyforlaravel.com/docs/v3/tenancy-bootstrappers/#filesystem-tenancy-boostrapper

hamees-allshore commented 3 hours ago

2 This pull request may fix this issue.

Tested the fix for my project.