despark / laravel-image-purify by lsimeonov

Laravel wrapper for https://github.com/despark/image-purify
2,344
1
7
Package Data
Maintainer Username: lsimeonov
Maintainer Contact: lsimeonov@despark.com (Ludmil Simeonov)
Package Create Date: 2017-05-24
Package Last Update: 2020-03-20
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-15 03:03:34
Package Statistics
Total Downloads: 2,344
Monthly Downloads: 3
Daily Downloads: 0
Total Stars: 1
Total Watchers: 7
Total Forks: 1
Total Open Issues: 1

About

This package is a laravel wrapper for despark/image-purify

Installation

Get it from composer

composer require despark/laravel-image-purify

With Laravel 5.5 or newer, the package will be discovered automatically. If you're using an older version of Laravel, add the following to your config/app.php file:

$providers = [
    ...
    Despark\Laravel\ImagePurify\ImagePurifyServiceProvider::class,
]

If you want an instance of the purifier you can dependency inject Despark\ImagePurify\Interfaces\ImagePurifierInterface

If instead you want to register a facade add this to you config/app.php

$aliases = [
    ...
    'ImagePurify' => \Despark\Laravel\ImagePurify\Facades\ImagePurify::class
]

If you need custom options you can publish the config via

php artisan vendor:publish --provider "Despark\Laravel\ImagePurify\ImagePurifyServiceProvider" --tag config

Example Usage


use Despark\ImagePurify\Interfaces\ImagePurifierInterface;

class HomeController extends Controller{
    
    public function optimize(ImagePurifierInterface $purifier){
        $purifier->purify('path/to/file');
    }
}

For additional options and usage see despark/image-purify documentation.