PHP code example of despark / laravel-image-purify
1. Go to this page and download the library: Download despark/laravel-image-purify library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
despark / laravel-image-purify example snippets
$providers = [
...
Despark\Laravel\ImagePurify\ImagePurifyServiceProvider::class,
]
$aliases = [
...
'ImagePurify' => \Despark\Laravel\ImagePurify\Facades\ImagePurify::class
]
use Despark\ImagePurify\Interfaces\ImagePurifierInterface;
class HomeController extends Controller{
public function optimize(ImagePurifierInterface $purifier){
$purifier->purify('path/to/file');
}
}
bash
php artisan vendor:publish --provider "Despark\Laravel\ImagePurify\ImagePurifyServiceProvider" --tag config