Download the PHP package yasmuru/ys-tinify-laravel without Composer
On this page you can find all versions of the php package yasmuru/ys-tinify-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yasmuru/ys-tinify-laravel
More information about yasmuru/ys-tinify-laravel
Files in yasmuru/ys-tinify-laravel
Package ys-tinify-laravel
Short Description Tinify API support for Laravel
License MIT
Informations about the package ys-tinify-laravel
Laravel Tinify
Modern Laravel package for TinyPNG/TinyJPG image compression API. Compress and optimize your images with ease.
Requirements
- PHP 8.2, 8.3, or 8.4
- Laravel 11.x, 12.x, or 13.x
Installation
Install the package via Composer:
Configuration
The package will automatically register itself (Laravel auto-discovery).
Publish the configuration file (optional):
Add your TinyPNG API key to your .env file:
You can get a free API key at tinypng.com/developers.
Optional: AWS S3 Configuration
If you want to directly upload compressed images to AWS S3, add these environment variables:
The bucket name is passed as an argument to each upload call, not configured globally.
Usage
Basic Image Compression
Direct Upload to AWS S3
Upload compressed images directly to S3 without saving locally:
Advanced Features
Resizing Images
You can combine compression with resizing using the Tinify SDK methods:
Important Notes
- S3 Permissions: Images uploaded directly to S3 are publicly readable by default. Configure your S3 bucket permissions according to your privacy requirements.
- API Limits: The free TinyPNG API tier allows 500 compressions per month. Monitor your usage with
getCompressionCount(). - Supported Formats: PNG, JPEG, and WebP formats are supported.
Testing
CI runs the suite against PHP 8.2/8.3/8.4 × Laravel 11/12/13.
License
The MIT License (MIT). Please see License File for more information.
Credits
- yasmuru
- All Contributors
All versions of ys-tinify-laravel with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
tinify/tinify Version ^1.5