everzel / weserv-php
Images.weserv.nl
1.0.4
2023-08-03 08:55 UTC
Requires
- php: ^8.1
README
This package provides a fluent PHP OOP builder for images.weserv.nl.
Installation
You can install the package via composer:
composer require everzel/weserv-php
Usage
use Everzel\WeservImages; use Everzel\Enums\Fit; $weserv = WeservImages::make('https://images.weserv.nl/lichtenstein.jpg', 'https://wsrv.nl', false); $url = $weserv ->w(512) ->h(512) ->we() ->fit(Fit::INSIDE->value); echo $url;
Or
function weserv(string $imageUrl) { return WeservImages::make($imageUrl, 'https://wsrv.nl', false); } $url = weserv('https://images.weserv.nl/lichtenstein.jpg') ->w(512) ->h(512) ->we() ->fit(Fit::INSIDE->value); echo $url;