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.
34 lines
821 B
PHP
34 lines
821 B
PHP
<?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', 'merchbay');
|
|
$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);
|
|
}
|
|
}
|