Add MinIO S3 storage integration
All checks were successful
Deploy Production (crewsportswear.com) / deploy (push) Successful in 2m9s
All checks were successful
Deploy Production (crewsportswear.com) / deploy (push) Successful in 2m9s
- Add minio disk configuration in filesystems.php - Create helper functions for MinIO URLs (minio_url, minio_image_url) - Update composer.json with AWS SDK (for future S3 support) - Add MinIO env vars to docker-compose.local.yml - Add .env examples for MinIO configuration
This commit is contained in:
33
app/helpers.php
Normal file
33
app/helpers.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
if (!function_exists('minio_url')) {
|
||||
/**
|
||||
* Generate MinIO URL for a file
|
||||
*
|
||||
* @param string $path File path relative to bucket
|
||||
* @return string Full MinIO URL
|
||||
*/
|
||||
function minio_url($path)
|
||||
{
|
||||
$bucket = env('MINIO_BUCKET', 'crewsportswear');
|
||||
$baseUrl = env('MINIO_URL', 'https://minio.crewsportswear.app');
|
||||
|
||||
// Remove leading slash if present
|
||||
$path = ltrim($path, '/');
|
||||
|
||||
return $baseUrl . '/' . $bucket . '/' . $path;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('minio_image_url')) {
|
||||
/**
|
||||
* Generate MinIO URL for an image in uploads/images/
|
||||
*
|
||||
* @param string $filename Image filename
|
||||
* @return string Full MinIO URL
|
||||
*/
|
||||
function minio_image_url($filename)
|
||||
{
|
||||
return minio_url('uploads/images/' . $filename);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user