Skip to content

renatomiguelsantos/imagify-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imagify-laravel

Laravel integration for the imagify.io API

It is a wrap around the official PHP library from imagify.io https://github.com/wp-media/imagify-php

Installation

Require this package with composer.

composer require renatomiguelsantos/imagify-laravel

Copy the package config to your local config with the publish command:

php artisan vendor:publish --provider="Imagify\Laravel\ServiceProvider"

And set an env variable IMAGIFY_APIKEY with your imagify.io api key.

Usage

use Imagify;

$handle = Imagify::optimize('path_to_image', [
    'level' => 'ultra',
    'resize' => [
        'width' => '1560',
    ],
]);

if (true === $handle->success) {
    $contents = file_get_contents($handle->image);
}

About

Laravel integration for the imagify.io API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages