image-server-laravel-adapter maintained by spacened
ImageServer
Image Server Adapter for Laravel
This package integrates a custom filesystem driver for storing images on a remote image server.
Installation
- Via Composer
composer require spacened/image-server
Usage
- Add the service provider to your
config/app.php(if not using auto-discovery):
YourNamespace\Providers\ImageServerServiceProvider::class,
Configure the disk in config/filesystems.php:
'image_server' => [
'driver' => 'image_server',
'url' => env('IMAGE_SERVER_URL') . '/img',
'endpoint' => env('IMAGE_SERVER_URL') . '/api/v1/upload',
'api_key' => env('IMAGE_SERVER_API_KEY'),
'project_id' => env('IMAGE_SERVER_PROJECT_ID')
],
-
Add the IMAGE_SERVER_URL, IMAGE_SERVER_API_KEY and IMAGE_SERVER_PROJECT_ID in your .env file
-
Use it in your application:
$file = $request->file('image')->store('/', 'image_server');
Change log
Please see the changelog for more information on what has changed recently.
Testing
composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author@email.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.