PHP code example of haidarrais / laravel-image-oxide

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

    

haidarrais / laravel-image-oxide example snippets


use Haidarrais\LaravelImageOxide\Facades\Oxide;

Oxide::image('/path/to/in.png')
    ->resize(800, 600, 'cover')
    ->format('webp')
    ->quality(85)
    ->to('/path/to/out.webp');

use Illuminate\Support\Facades\Storage;

Storage::disk('s3')->oxideResize('photos/in.png', 800, 600, 'webp');

use Haidarrais\LaravelImageOxide\Facades\Image;

Image::make('/in.png')
    ->resize(800, 600, fn ($c) => $c->aspectRatio())
    ->encode('webp')
    ->save('/out.webp');
bash
php artisan vendor:publish --tag=image-oxide-config