PHP code example of optidash / laravel

1. Go to this page and download the library: Download optidash/laravel 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/ */

    

optidash / laravel example snippets


Optidash\OptidashLaravel\OptidashServiceProvider::class

'Optidash' => Optidash\OptidashLaravel\Facades\Optidash::class

use Optidash;

Optidash::fetch('https://www.website.com/image.jpg')->optimize(array(
    'compression' => 'medium'
))
->resize(array(
	'width' => 640,
	'height' => 480
))
->filter(array(
    'blur' => array(
        'mode' => 'gaussian',
        'value' => 10
    )
))
->toFile('path/to/output.png', function ($error, $meta) {
    if (!empty($error)) {
        throw new Exception($error);
    }

    // You'll find the full JSON metadata within the `meta` variable
});
bash
php artisan vendor:publish --provider="Optidash\OptidashLaravel\OptidashServiceProvider"