Skip to content

GlideController ​

File: src/Http/Controllers/GlideController.php
Namespace: Unusualify\Modularous\Http\Controllers

Single-action invokable controller that serves on-the-fly image transformations via the Glide library.

Signature ​

php
public function __invoke(string $path, Application $app): mixed

Accepts an image $path (relative to the configured source), applies transformation parameters from the query string, and streams the transformed image back to the browser.

Transformation Parameters ​

Parameters are passed as query string values and processed by Glide:

ParameterExampleDescription
w?w=300Width in pixels
h?h=200Height in pixels
fit?fit=cropFit mode (contain, max, fill, crop)
q?q=80JPEG/WebP quality (1–100)
fm?fm=webpOutput format

See the Glide documentation for the full parameter reference.

URL Signing ​

Glide URLs are signed by default to prevent abuse. The signing key is taken from modularous.glide.sign_key. Requests with an invalid signature return a 403 response.