/
Laravel 과 minio 연동
Laravel 과 minio 연동
설치
flysystem 용 s3 minio 드라이버를 설치합니다.
composer require coraxster/flysystem-aws-s3-v3-minio
MinIO 용 ServiceProvider 를 app/Providers/MinIOStorageServiceProvider.php 에 만듭니다.
config/app.php 의 프로바이더 항목에 작성한 Provider 를 등록합니다.
App\Providers\MinIOStorageServiceProvider::class
config/filesystems.php 에 작성한 프로바이더를 등록합니다.
'disks' => [ // other disks 'minio' => [ 'driver' => 'minio', 'key' => env('MINIO_KEY', 'your minio server key'), 'secret' => env('MINIO_SECRET', 'your minio server secret'), 'region' => 'us-east-1', 'bucket' => env('MINIO_BUCKET','your minio bucket name'), 'endpoint' => env('MINIO_ENDPOINT','http://localhost:9000') ] ]
php artisan tinker 로 팅커 콘솔을 띄우거나 예제 코드를 돌려서 정상 동작 여부를 확인합니다.
Storage::disk('minio')->put('avatars/1', $fileContents);
minio 에 저장한 객체를 URL 로 바로 접근하려면 버킷 policy 를 public 으로 설정해야 합니다.
$ mc policy set public localminio/mybucket
같이 보기
Ref
, multiple selections available,
Related content
minio client 사용법
minio client 사용법
More like this
MinIO Server - 오픈소스 오브젝트 스토리지 서버(Open Source object storage server)
MinIO Server - 오픈소스 오브젝트 스토리지 서버(Open Source object storage server)
More like this
Sublime Text 3 로 PHP 개발 환경 구성하기
Sublime Text 3 로 PHP 개발 환경 구성하기
More like this
PHP Flysystem 패키지를 V2 로 업그레이드하기
PHP Flysystem 패키지를 V2 로 업그레이드하기
More like this
PhpStorm 으로 라라벨 개발 하기
PhpStorm 으로 라라벨 개발 하기
More like this
Laravel doctrine ORM
Laravel doctrine ORM
More like this