Skip to content

ELEMENTS storage driver for Laravel/Lumen.

License

Notifications You must be signed in to change notification settings

biigle/laravel-elements-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel ELEMENTS Storage Driver

ELEMENTS storage driver for Laravel/Lumen.

Warning: This driver guesses the file MIME types based on the filename (as ELEMENTS does not provide the MIME type). MIME types can be easily spoofed if the files are not under your control.

Installation

Require the package with Composer:

composer require biigle/laravel-elements-storage

Laravel

For Laravel 5.4 and lower, add the service provider to config/app.php:

Biigle\Filesystem\ElementsServiceProvider::class,

Lumen

Add the service provider to bootstrap/app.php:

$app->register(Biigle\Filesystem\ElementsServiceProvider::class);

Configuration

Add a new storage disk to config/filesystems.php:

'disks' => [
   'elements' => [
      'driver' => 'elements',
      'baseUri' => env('ELEMENTS_BASE_URL', ''), // e.g. https://elements.example.com
      'token' => env('ELEMENTS_API_TOKEN', ''), // e.g. my-elements-api-token
   ],
]

Additional configuration options:

  • disableAsserts (default: false) [ref]

  • prefix (default: null): Prefix to use for all file paths.