Download the PHP package minipng/laravel-minipng without Composer
On this page you can find all versions of the php package minipng/laravel-minipng. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download minipng/laravel-minipng
More information about minipng/laravel-minipng
Files in minipng/laravel-minipng
Package laravel-minipng
Short Description Laravel package for MiniPNG API integration - Image and PDF processing
License MIT
Homepage https://github.com/minipng/laravel-minipng
Informations about the package laravel-minipng
Laravel MiniPNG Package
Laravel package for integrating with MiniPNG API - Image and PDF processing services.
Version: 1.0.0
Release Date: June 29, 2025
Features
- 🖼️ Image Compression - Compress images while maintaining quality
- 🔄 Image Format Conversion - Convert between PNG, JPG, JPEG, WebP, GIF
- 📄 PDF Compression - Reduce PDF file sizes
- 🖼️ PDF to Images - Convert PDF pages to images
- 👤 User Profile - Get API usage information
- 🛡️ Error Handling - Comprehensive exception handling
- ⚙️ Configuration - Easy configuration management
Requirements
- PHP 8.0 or higher
- Laravel 9.0, 10.0, or 11.0
- MiniPNG API key
Getting Started
1. Get Your API Token
To use this package, you need a MiniPNG API token:
- Create an account or login at https://minipng.com/en/login
- Get your API token from https://minipng.com/user/panel/api-token
- Enjoy 500 free credits for one month upon registration
2. Installation
Install the package via Composer:
3. Publish Configuration
Publish the configuration file:
4. Configure API Key
Add your MiniPNG API key to your .env
file:
Configuration
The configuration file config/minipng.php
contains the following options:
Usage
Using the Facade
Using Dependency Injection
Using the Service Container
API Methods
Image Processing
compressImage(string $sourceUrl): array
Compress an image file to reduce its size while maintaining quality.
convertImage(string $sourceUrl, string $outputFormat, ?int $quality = null): array
Convert an image to a different format.
Supported formats: png
, jpg
, jpeg
, webp
, gif
PDF Processing
compressPdf(string $sourceUrl): array
Compress a PDF file to reduce its size while maintaining quality.
convertPdfToImages(string $sourceUrl, ?string $imagesQuality = null, ?string $imagesFormat = null): array
Convert a PDF document to a set of images (one per page).
Quality options: low
, medium
, high
Format options: png
, jpg
User Information
getProfile(): array
Get user profile and API usage information.
Response Format
Success Response (200/201)
Error Response (400/404/500)
Error Handling
The package throws MiniPNGException
for API errors:
Examples
Controller Example
Artisan Command Example
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- MiniPNG Team
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Support
For support, please contact: [email protected]