msonowal / laravel-tinify by msonowal

Laravel Facade for tinify API
4,039
5
4
Package Data
Maintainer Username: msonowal
Maintainer Contact: manash149@gmail.com (Manash Jyoti Sonowal)
Package Create Date: 2017-03-14
Package Last Update: 2022-07-15
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-30 15:08:58
Package Statistics
Total Downloads: 4,039
Monthly Downloads: 102
Daily Downloads: 3
Total Stars: 5
Total Watchers: 4
Total Forks: 3
Total Open Issues: 0

laravel-tinify

This package provides integration with the Tinify a.k.a TinyPNG API.

Latest Stable Version Total Downloads

The package simply provides a Tinify facade that acts as a wrapper to the tinify/tinfiy-php

It was originaly developed by Marvin Oßwald

I added functionality to use of laravel bulit in config cache helper which was having issues of returning null when configs are cached via php artisan config:cache because it was directly loading via env helper. So, I converted it to use the api_key from config which can be defined to load from env and still use the php artisan config:cache command and it works.

Installation

Install via composer by adding the following to your composer.json:

    ...
    "require": {
        "msonowal/laravel-tinify": "~1.0"
    }
    ...

Add service provider to config/app.php:

    ...
    msonowal\LaravelTinify\LaravelTinifyServiceProvider::class
    ...

Add alias to config/app.php:

    ...
    'Tinify' => msonowal\LaravelTinify\Facades\Tinify::class
    ...

Configuration

Publish the Configuration for the package which will create the config file tinify.php inside config directory

php artisan vendor:publish --provider="msonowal\LaravelTinify\LaravelTinifyServiceProvider"

Set a env variable "TINIFY_APIKEY" with your issued apikey or set api_key into config/tinify.php

This package is available under the MIT license.