zhanang19 / medialibrary-gitlab-storage
Spatie Medialibrary Gitlab Storage with custom URL generator
v1.1
2020-05-08 02:49 UTC
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.3
- illuminate/support: ^7.0
- spatie/laravel-medialibrary: ^7.0.0
- zhanang19/laravel-gitlab-storage: ^1.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-08 13:00:27 UTC
README
This package provide an URL Generator for assets that stored in Gitlab Storage.
Installation
Run command composer require zhanang19/medialibrary-gitlab-storage
This package is tested only in Laravel 7
Configuration
- This package require
spatie/medialibrary:^7.0
by default. So, you can removespatie/medialibrary
from yourcomposer.json
. Configure it to use gitlab as media disk in your.env
file
MEDIA_DISK="gitlab"
- This package require
zhanang19/laravel-gitlab-storage
by default. Just initiate config for that
# config/filesystems.php 'disks' => [ 'gitlab' => [ 'driver' => 'gitlab', 'project_id' => env('GITLAB_PROJECT_ID'), 'access_token' => env('GITLAB_ACCESS_TOKEN', ''), 'branch' => env('GITLAB_BRANCH', 'master'), 'base_url' => env('GITLAB_BASE_URL', 'https://gitlab.com'), 'debug' => (bool)env('GITLAB_DEBUG', env('APP_DEBUG', false)) ] ],
- Configure custom url generator in
medialibrary.php
config
# config/medialibrary.php 'url_generator' => \Zhanang19\MediaLibraryGitlab\GitlabUrlGenerator::class,
Caveat
Conversion and responsive images doesn't working correctly. This cause by Gitlab API doesn't support streaming file to copy and process the image.