johnnyxlemonade / admin-image
Reusable Lemonade module image URL delivery over the Framework image pipeline.
Requires
- php: >=8.3
- johnnyxlemonade/framework: dev-main
- psr/http-message: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.94
- nyholm/psr7: ^1.8
- phpstan/phpstan: ^2.3
- phpstan/phpstan-strict-rules: ^2.1
- phpunit/phpunit: ^12.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-20 13:21:28 UTC
README
johnnyxlemonade/admin-image provides variant definitions
and public image delivery for Lemonade Framework applications. It exposes
ImageAssetResolverInterface for resolving source images and registers the
public endpoint that delivers a declared variant.
The package does not own upload persistence, file lifecycle, or a media catalogue. Those responsibilities belong to the consuming platform or host application. Image variants are declarative delivery definitions; the resolver remains authoritative for whether a source image is available.
Requirements
- PHP 8.3 or newer, tested on PHP 8.3, 8.4, 8.5 and 8.6.
johnnyxlemonade/framework:dev-main.
Installation
composer require johnnyxlemonade/admin-image:dev-main
Register Lemonade\Image\ImagePackageServiceProvider in the host application,
bind ImageAssetResolverInterface to the owner of image metadata, and register
the image variants the host is allowed to deliver.
The single public URL format is /api/image/{variant}/{fileId}, including
/api/image/original/{fileId} for originals. ImageUrlGenerator::url($variant, $fileId) and originalUrl($fileId) accept positive integer file IDs. The
resolver maps each ID to its stored asset; Admin Platform uses system_file.
Module codes remain internal metadata and are not part of the URL.
Admin Platform registers admin-datagrid, admin-thumb, and admin-preview.
Frontend variants are registered by the host. Previous URLs containing a module
code are no longer supported.
Package boundaries
johnnyxlemonade/frameworkowns the base runtime and image processing primitives.- Admin Image owns variant registration and delivery by global file ID.
- The consuming platform or host owns original persistence, authorization, and source availability.
Development and QA
From the package root, run:
composer cs:check
composer stan
composer test
composer qa
Private storage
Image delivery streams files from the Framework path resolver. Persistent originals
live under storage/uploads/images/originals; regeneratable variants live under
storage/cache/images. URLs and HTTP cache validators are unchanged. Neither
variants nor originals require direct web-server access to public/uploads.
There is no legacy-path fallback: deployment must coordinate the physical data move.