Skip to content

Helper, facade & Blade

All three generate the same URL through Fomvasss\Imagepresets\Services\ImagepresetService::url(). Usage — Generating URLs.

Entry pointSignature
Helperimagepreset_url(string $src, array|string $params = [], bool $bypass = false): string
FacadeFomvasss\Imagepresets\Facades\Imagepreset::url(string $src, array|string $params = [], bool $bypass = false): string
Blade@imagepreset($src, $params = [], $bypass = false)
Serviceapp(ImagepresetService::class)->url(...), also bound as app('imagepresets')
ArgumentDescription
$srcLocal path or http(s):// URL, see Image sources
$paramsArray of query parameters, or a string — a preset name, same as ['preset' => $name]
$bypassAdd a trusted token (_t) when trusted_bypass is on, see Trusted bypass
ConditionResult
backend_url_enabled = false$src unchanged
route.signed = trueURL::signedRoute(<route.name>, $params) — absolute, permanent, with signature
otherwiseroute(<route.name>, $params) — absolute URL

Parameters are merged with src, sorted by key and cast to strings before the URL is built. Nothing is validated at this point.

@imagepreset(...) compiles to <?php echo imagepreset_url(...); ?>. The output is not HTML-escaped.

MethodGET
URI/{route.prefix}, default /imagepreset
Nameroute.name, default imagepreset
ControllerFomvasss\Imagepresets\Http\Controllers\ImagepresetController (invokable)
Middlewareroute.middleware (default throttle:2400,1), plus signed when route.signed is on

The route can be used directly: route('imagepreset', ['src' => 'photo.jpg', 'w' => 300]).

BindingLifetime
ImagepresetService (alias imagepresets)singleton
ImagepresetValidator, SourceResolver, GlideProcessor, SvgProcessor, ResponseBuilder, RemoteUrlNormalizersingletons

All classes are final; there are no events or extension hooks.