Download the PHP package triginarsa/minio-storage-utils without Composer
On this page you can find all versions of the php package triginarsa/minio-storage-utils. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download triginarsa/minio-storage-utils
More information about triginarsa/minio-storage-utils
Files in triginarsa/minio-storage-utils
Package minio-storage-utils
Short Description A comprehensive MinIO storage service package for Laravel with file processing capabilities
License MIT
Informations about the package minio-storage-utils
MinIO Storage Utils for Laravel
A simple PHP library for secure file handling with MinIO object storage, designed for Laravel applications.
What it does
- 🔒 Secure file uploads with virus/malware scanning
- 🖼️ Image processing (resize, compress, watermark, thumbnails)
- 🎬 Video processing (optional, requires FFmpeg)
- 📄 Document security scanning
- 🔗 Flexible URLs (public or private with expiration)
- 📝 Smart file naming (hash, slug, or original names)
Installation
Step 1: Install via Composer
Step 2: Publish Configuration
Step 3: Configure MinIO Disk
Add to config/filesystems.php:
Step 4: Environment Setup
Change this value on .env file:
Add to your .env file:
Important Notes:
- Set
MINIO_STORAGE_DISKtominio(matching your disk name inconfig/filesystems.php). - By default, URLs are public (unsigned). To make signed URLs the default, set
MINIO_URL_SIGNED_BY_DEFAULT=true. - You can set a default expiration for signed URLs with
MINIO_URL_DEFAULT_EXPIRATION=3600(in seconds). - Video processing is enabled automatically when FFmpeg is installed (FFmpeg is auto-detected).
- Files with the same name will automatically get a number suffix (e.g.,
image_1.jpg,image_2.jpg). - For others env can check on .env.example.
Quick Start
Basic File Upload
Image Upload with Processing
Get File URLs
Example Usage:
Laravel Example: getUrlPublic with fallback
Laravel Example: getUrlPublic from another bucket
Get File Metadata
Example Usage:
Delete Files
Example Usage:
Examples
Check out the examples/ folder for complete working examples:
Basic Examples
- basic-usage.php - Non-Laravel usage example
- laravel-basic-usage.php - Simple Laravel file upload
Image Processing Examples
- laravel-image-processing-example.php - Image resize, compress, and thumbnails
- laravel-watermark-example.php - Add watermarks to images
Advanced Examples
- laravel-doc-example.php - Document upload with security scanning
- laravel-security-example.php - Security scanning and threat detection
- laravel-video-usage.php - Video processing with FFmpeg
API References
If you want to see the detailed API reference, check out this API REFERENCE document.
Configuration Options
Optional env Variables
Optional .env variable:
Image Processing
Thumbnail Generation
Security Scanning
Video Processing (Optional)
File Naming Strategies
- hash:
a1b2c3d4e5f6...123456789.jpg(secure, prevents duplicates) - slug:
my-vacation-photo-1704067200.jpg(SEO-friendly) - original:
My Vacation Photo.jpg(keeps original name)
URL Generation
The library generates two types of URLs, with public (unsigned) URLs as the default.
Public URLs (Default Behavior)
Public URLs provide direct, unsigned access to files, suitable for content in publicly accessible buckets.
- Configuration:
MINIO_URL_SIGNED_BY_DEFAULT=false(in.env) -
How to Generate:
- Use Case: Public assets like images, stylesheets, or public documents. Requires your bucket to have a public access policy.
Signed URLs (For Private Content)
Signed URLs are secure, temporary links to private files. They are ideal for sensitive or user-specific content that should not be publicly accessible.
-
How to Generate:
- Making Signed URLs the Default:
- Set
MINIO_URL_SIGNED_BY_DEFAULT=truein your.envfile. - You can also set a default expiration for all signed URLs with
MINIO_URL_DEFAULT_EXPIRATION=3600(in seconds).
- Set
Error Handling
Requirements
- PHP 8.2+
- Laravel 9.0+ (including Laravel 13)
- MinIO server or S3-compatible storage
- GD extension (for image processing)
- FFmpeg (optional, for video processing)
FFmpeg Installation (Optional)
For video processing features:
Testing
For details on the test suite, fixtures, and how to write your own tests, see the Testing Guide.
Security Features
The library automatically scans uploads for:
- Malicious code (PHP, JavaScript, etc.)
- Virus signatures
- Suspicious file types
- Embedded scripts in images
- Macro-enabled documents
Contributing
Contributions welcome! Please check the issues page.
License
MIT License
All versions of minio-storage-utils with dependencies
aws/aws-sdk-php Version ^3.0
league/flysystem Version ^3.0
league/flysystem-aws-s3-v3 Version ^3.0
intervention/image Version ^3.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0