biigle / laravel-elements-storage by mzur

ELEMENTS storage driver for Laravel/Lumen.
20
0
3
Package Data
Maintainer Username: mzur
Maintainer Contact: martin@zurowietz.de (Martin Zurowietz)
Package Create Date: 2021-08-03
Package Last Update: 2022-05-02
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-29 15:01:37
Package Statistics
Total Downloads: 20
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 3
Total Forks: 0
Total Open Issues: 1

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.