2017 © Pedro Peláez
 

library laravel-azure-file-storage-driver

Azure File Storage filesystem driver for Laravel

image

academe/laravel-azure-file-storage-driver

Azure File Storage filesystem driver for Laravel

  • Tuesday, March 27, 2018
  • by judgej
  • Repository
  • 1 Watchers
  • 5 Stars
  • 177 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 157 % Grown

The README.md

Latest Stable Version Total Downloads Latest Unstable Version GitHub license GitHub issues, (*1)

Microsoft Azure File Storage Filesystem Driver for Laravel 6, 7 and 9

This package allows Microsoft Azure File Storage to be used as a filesystem in laravel 5 and 6., (*2)

Installation

composer require academe/laravel-azure-file-storage-driver

This package just extends the filesystem driver, and provides no additional services., (*3)

Configuration

Add the following to your config/filesystems.php:, (*4)

[
    ...
    'disks' => [
        ...
        // Name this disk for your application to reference.
        'azure-file-storage' => [
            // The driver provided by this package.
            'driver' => 'azure-file-storage',

            // Account credentials.
            'storageAccount' => env('AZURE_FILE_STORAGE_ACCOUNT'),
            'storageAccessKey' => env('AZURE_FILE_STORAGE_ACCESS_KEY'),

            // The file share.
            // This driver supports one file share at a time (you cannot
            // copy or move files between shares natively).
            'fileShareName' => env('AZURE_FILE_STORAGE_SHARE_NAME'),

            // Optional settings
            'disableRecursiveDelete' => false,
            'driverOptions' => [],
            'root' => 'root/directory', // Without leading '/'
        ],
    ],
];

If you want to use multiple Azure file storage shares, then create additional entries in the disks array with the appropriate settings for each share., (*5)

An example list of environment variable entries can be found in .env.example. You can add that to your .env file and add your credentials there., (*6)

Usage

See the Laravel documentation for general usage of a file system in Laravel. A simple example follows:, (*7)

use Storage;

// List all files recursively from the root of the Azure share:

$files = Storage::disk('azure-file-storage')->listAll();
dump($files);

// Example:
// array:25 [▼
//   0 => "file1.txt"
//   1 => "foo/file2.txt"
//   2 => "foo/dee/dar/bigfile.txt"
// ]

Testing

PHPunit tests will work against any file storage share given criteria set in .env based on .env.example., (*8)

The Versions

27/03 2018

dev-master

9999999-dev https://github.com/academe

Azure File Storage filesystem driver for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel driver azure file storage

26/02 2018

0.2.0

0.2.0.0 https://github.com/academe

Azure File Storage filesystem driver for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel driver azure file storage

25/02 2018

0.1.1

0.1.1.0 https://github.com/academe

Azure File Storage filesystem driver for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel driver azure file storage

25/02 2018

0.1.0

0.1.0.0 https://github.com/academe

Azure File Storage filesystem driver for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel driver azure file storage