el-schneider/statamic-ai-labels
Statamic AI Labels is a Statamic addon that brings AI-powered labeling to your content workflow, automatically generating labels and tags for entries so editors can organize, filter, and find content faster with less manual work. Built for Laravel-based Statamic sites.
This package composites a badge onto an image (product thumbnails, avatars, status overlays). The whole public surface is small: one renderer, one config file, one new knob (padding).
composer require <vendor>/<package> — pin the minor ("^0.1.2") while the package is pre-1.0; config keys are still moving.php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider" and confirm config/<package>.php appears. Check the service provider's mergeConfigFrom too — if a key is missing from your published file, the package default wins silently.src/BadgeRenderer.php or similar) to see whether it uses GD, Imagick, or Intervention Image. That determines what formats and alpha behaviour you actually get.// config/badge.php
'padding' => 0.25, // fraction of badge width, not pixels
$path = Badge::make(storage_path('app/products/1.jpg'))
->badge(resource_path('img/sale.png'))
->save(storage_path('app/products/1-badged.jpg'));
With a badge sized at 25% of the image width (100px on a 400px image), 0.25 gives a 25px gap from the edge. That is the 0.1.0 spacing, so existing visual baselines should match — if you are coming from 0.1.1, expect a shift and re-check your snapshots.
config/badge.php and drive it from an env var (BADGE_PADDING=0.25) so a designer can tune the gap via config cache rebuild rather than a code change. Because it is a ratio, the same value works for every image size — that is the point of the change.$padding = $context === 'thumbnail' ? 0.1 : config('badge.padding');
8 / 32 = 0.25 in a comment next to the config line. Future-you will not remember it is a fraction.config('badge.padding'). Adding a config value that affects pixels but not the cache key is the classic cause of "it didn't change" bug reports.BadgeRequested event, then serve the derived file from storage/CDN. Never render on a hot listing page.padding.0 is genuinely flush. Flush means badge pixels touch the image edge; with rounded badge corners or anti-aliased edges you may see a sliver of background or a clipped stroke. 0.02–0.05 is usually the real "flush" you want.max(0, min(0.5, $padding)).config:cache, changing .env alone does nothing until you php artisan config:clear. Combined with the cache-key issue above, this produces phantom "padding ignored" reports.0.25 restores 0.1.0 spacing, which implies 0.1.1 used something else. Re-generate derived images after upgrading; nothing in the package will invalidate your stored outputs.badgeWidth * padding) once per render at debug level. It converts a float config into a number you can eyeball against the mockup in seconds.BadgeSettings::padding()) so a future rename or default change is a one-file edit.How can I help you explore Laravel packages today?