Skip to content

HumanInitiative/yii2-minio-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Yii2 MinIO Component

Ini adalah komponen sisi server untuk akses ke MinIO.

Fitur

Bucket (check, create, policy)

Folder (create)

File (upload, delete, check)

Get Pre-Signed URL (private file)

Instalasi

1. Install via Composer

composer require humaninitiative/yii2-minio-component:"dev-master"

2. Config Aplikasi

Tambahkan pada .env :

MINIO_REGION={region}
MINIO_ENDPOINT={endpoint url} 
MINIO_KEY={user key}
MINIO_SECRET={user secret pass}
MINIO_DEFAULT_BUCKET={default bucket}

Lalu tambahkan pada config/web.php :

'components' => [
	'minio' => [
		'class' => 'humaninitiative\s3\MinioComponent',
		'version' => 'latest',
		'use_path_style_endpoint' => true,
		'region' => $_ENV['MINIO_REGION'],
		'endpoint' => $_ENV['MINIO_ENDPOINT'],
		'credentials' => [
			'key' => $_ENV['MINIO_KEY'],
			'secret' => $_ENV['MINIO_SECRET'],
		],
		'bucket' => $_ENV['MINIO_DEFAULT_BUCKET'],
	],
],

Copy FileController.php ke modules/api/controllers :

cp vendor/humaninitiative/yii2-minio-component/src/FileController.php modules/api/controllers/

Ubah namespace menjadi app\modules\api\controllers.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages