robiussani152/shortpixel-image-compressor

This package is for optimize image using shortpixel api.

1.0.0 2020-10-01 15:47 UTC

This package is auto-updated.

Last update: 2024-05-29 04:49:34 UTC


README

This package is designed for compress uploaded image.

Requirements

  1. At least laravel v7
  2. Http client

Necessary steps

1. Configure filessystem.php

Set FILESYSTEM_DRIVER to public

2. Storage link command

Run

php artisan storage:link

3. Configure queue to Database check it from Here

Getting Started

1. Install

Run the following command:

composer require robiussani152/shortpixel-image-compressor

2. Register (for Laravel < 5.5)

Register the service provider in config/app.php

Robiussani152\ShortPixelImageCompressor\ShortPixelImageCompressorServiceProvider::class,

Add alias if you want to use the facade.

'ShortPixelImageCompressor' => Robiussani152\ShortPixelImageCompressor\Facades\ShortPixelImageCompressor::class,

Usage

You can use the facade `

ShortPixelImageCompressor::compress('path_to_the_image.extension');

License

The MIT License (MIT). Please see LICENSE for more information.