daikazu/laravel-glider/glider-development
Claude Code and agent skill by daikazu/laravel-glider
- community
Checking that the SKILL.md file is still in the repository.
Use for any task involving images served through daikazu/laravel-glider: rendering <x-glider-img>, <x-glider-img-responsive>, <x-glider-bg>, or <x-glider-bg-responsive> components, glide-* attributes, the Glider facade, image presets and background presets, responsive srcset or sizes, focal points, remote images, watermarks, the glider:build / glider:clear / glider:convert commands, disk-based (S3) caches, static serving, or signed URL / on_the_fly / restrict_to_presets security settings. Also use when converting plain <img> tags to Glider or debugging 400/403/404 image responses under /img. Do not use for general image upload handling or non-Glider media libraries.
Install
npx vskill@latest install daikazu/laravel-glider/glider-developmentSKILL.md
Laravel Glider Development
Laravel Glider wraps League/Glide: images are transformed on request, cached, and served from signed, human-readable URLs like /img/coins/hero~{token}.webp. Configuration lives in config/glider.php (publish with php artisan vendor:publish --tag="glider-config").
Core rules
srcis a path relative toglider.source(defaultresource_path('assets')), or a fullhttp(s)://URL for remote images. Do not passasset()/public_path()output or a leading/images/public prefix.- Glide manipulation params go on components as
glide-{param}attributes. Any attribute without the prefix is rendered as a normal HTML attribute (alt,class,loading, ...). - Never hand-write
/img/...URLs. The token and signature are generated for you, and an unsigned or tampered URL returns 404 whenglider.secureis on. glider.defaults(defaultfm=webp,q=85) applies to every image unless overridden.- Check
config/glider.phpfor an existing preset before adding one-off sizes. Add new shared sizes as presets.
Components
<x-glider-img>
width/height attributes are added automatically when the source is on a local filesystem.
<x-glider-img-responsive>
Generates a srcset. Widths are calculated from the source image unless you pass srcset-widths.
- Give it an explicit
sizeswhenever you know the layout slot, so the browser picks the right candidate on the first request. - Without
sizes,loading="lazy"images getsizes="auto", and eager images get a smallonloadscript that setssizesafter the first paint.
<x-glider-bg> (single background image)
Props: position (default center), size (default cover), repeat (default no-repeat), attachment (default scroll), fallback, and lazy (emits data-bg-lazy/data-bg-src for your own lazy loader). Use glide-preset for regular presets here. This component does not accept background_presets.
<x-glider-bg-responsive> (breakpoint backgrounds)
preset here is a key in glider.background_presets, not in glider.presets. It also accepts the same CSS props as <x-glider-bg>.
With neither preset nor breakpoints, built-in breakpoints from 480px to 1920px wide are used. glide-* attributes are merged into every breakpoint, but a breakpoint's own params win, so glide-w has no effect when the breakpoint sets w. An unknown preset name throws an InvalidArgumentException.
Focal points
focus works on all four components. It accepts center, top, bottom, left, right, top-left, top-right, bottom-left, bottom-right, or x,y percentages (focus="75,25"). It sets CSS (object-position / background-position) and does not change the pixels. For a server-side crop, use glide-fit="crop-top" or glide-fit="crop-25-75" (optionally with zoom: crop-25-75-2).
Facade
Use this for URLs outside Blade components: JSON APIs, Open Graph images, mail, and Livewire/JS payloads.
Common Glide params
| Param | Values | |
|---|---|---|
w, h | pixels | |
fit | contain, max, fill, stretch, crop, crop-{position}, crop-{x}-{y}[-{zoom}] | |
q | 1-100 | |
fm | jpg, pjpg, png, gif, webp, avif | |
blur, sharp, bri, con, gam | effects | |
filt | greyscale, sepia | |
mark | watermark path relative to glider.watermarks | |
strip | true removes EXIF/GPS metadata |
Output size is capped by glider.max_image_size (total pixels, default 2000x2000).
Presets
Use regular presets with glide-preset="thumbnail" or ['preset' => 'thumbnail']. Background presets are keyed by breakpoint name (xs, sm, md, lg, xl) or pixel width, and are only used by <x-glider-bg-responsive preset="...">.
Artisan commands
php artisan glider:buildscansglider.build.paths(defaultresources/views) for components andGlider::url()calls with a literalsrc, then prebuilds those conversions. Dynamic sources (:src="$var",{{ }}) are reported as skipped and still work on the fly. Flags:--dry-run, and--static(bakes intopublic/{base_url}instead of the configured cache). It exits non-zero if any conversion fails.php artisan glider:clearclears the configured cache (paths and disks).--staticclears the bakedpublic/{base_url}tier instead.--forceskips the production confirmation.php artisan glider:convertrewrites plain<img>tags to Glider components. Always run with `--dry-run` first. Options:--backup,--path=resources/views,--responsive, and--image-path=/images/(the public prefix to strip so srcs resolve againstglider.source; use--image-path=to strip nothing). Only literalsrcvalues andasset('literal')are converted.
Security settings
These three settings are independent and can be combined:
secure(GLIDER_SECURE, defaulttrue): HMAC-signed URLs usingsign_key(defaultAPP_KEY). Keep it on in production.on_the_fly(GLIDER_ON_THE_FLY, defaulttrue): whenfalse, cached conversions are served and anything uncached returns 404. Pair it withglider:build. Dynamicsrcvalues will 404 unless they are already cached.restrict_to_presets(GLIDER_RESTRICT_TO_PRESETS, defaultfalse): only preset expansions, defaults-only requests, and format-only changes are allowed. Anything else returns 403.
Path traversal, CSS injection in background props, and SSRF (private IPs, localhost, metadata endpoints) are blocked automatically. Do not add custom workarounds for them.
Debugging image responses
- 404: a missing or invalid signature (a hand-built or edited URL, or a changed
APP_KEY/GLIDER_SIGN_KEY), a source file missing relative toglider.source, a failed remote fetch, oron_the_fly=falsewith the conversion not cached. - 403: params rejected by
restrict_to_presets. - 400: a path rejected by the traversal/null-byte validator, or invalid Glide params.
- After changing presets or defaults, run
php artisan glider:clearso stale conversions are regenerated.
Filesystems and deployment
source, cache, and watermarks each accept a path string or a disk reference (['disk' => 's3', 'prefix' => 'glider-cache']). In .env, use GLIDER_CACHE_PATH, or use GLIDER_CACHE_DISK with GLIDER_CACHE_PREFIX (the disk form wins). SOURCE and WATERMARKS follow the same pattern. A non-local source disables automatic width/height and automatic srcset widths, so pass srcset-widths explicitly.
Pointing the cache at public/{base_url} (e.g. GLIDER_CACHE_PATH=public/img) lets the web server serve cached files directly, so PHP only runs for cache misses.
| Situation | Recipe | |
|---|---|---|
| Persistent server(s) | GLIDER_CACHE_PATH=public/img, then glider:build on deploy | |
| Ephemeral/autoscaling, mostly dynamic images | GLIDER_CACHE_DISK=s3, then glider:build on deploy | |
| Ephemeral, mostly static template images | GLIDER_CACHE_DISK=s3 at runtime, plus glider:build --static during the build step |
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingresources/boost/skills/glider-development/SKILL.md
Popularity
- Repository stars
- 93
- Repository forks
- 4
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/daikazu/laravel-glider/glider-development)