feat: Add MinIO storage support and update image URLs
All checks were successful
Deploy Production (merchbay.com) / deploy (push) Successful in 2m54s

- Implemented MinIO storage driver in AppServiceProvider for S3-compatible storage.
- Added helper functions to generate MinIO URLs for files and images.
- Updated filesystem configuration to include MinIO settings.
- Modified site configuration to include MinIO URL.
- Enhanced Docker Compose configuration for local development with MinIO.
- Updated various Blade templates to use MinIO URLs for images instead of local paths.
- Ensured all image references in views are now pointing to MinIO storage.
This commit is contained in:
Frank John Begornia
2026-05-13 00:25:23 +08:00
parent 6c97e60805
commit ad8d8d7564
28 changed files with 229 additions and 76 deletions

View File

@@ -4,6 +4,8 @@ use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Storage;
use League\Flysystem\Filesystem;
use League\Flysystem\Sftp\SftpAdapter;
use League\Flysystem\AwsS3v3\AwsS3Adapter as AwsS3v3Adapter;
use Aws\S3\S3Client;
use Illuminate\Support\Facades\Blade;
class AppServiceProvider extends ServiceProvider {
@@ -27,6 +29,21 @@ class AppServiceProvider extends ServiceProvider {
Storage::extend('sftp', function ($app, $config) {
return new Filesystem(new SftpAdapter($config));
});
Storage::extend('minio', function ($app, $config) {
$client = new S3Client([
'credentials' => [
'key' => $config['key'],
'secret' => $config['secret'],
],
'region' => $config['region'],
'version' => 'latest',
'endpoint' => $config['endpoint'],
'use_path_style_endpoint' => filter_var($config['use_path_style_endpoint'] ?? true, FILTER_VALIDATE_BOOLEAN),
]);
$adapter = new AwsS3v3Adapter($client, $config['bucket']);
return new Filesystem($adapter);
});
}
/**