Search by

johnnyxlemonade / admin-image

johnnyxlemonade

Reusable Lemonade module image URL delivery over the Framework image pipeline.

Package info

github.com/johnnyxlemonade/admin-image

pkg:composer/johnnyxlemonade/admin-image

Statistics

Installs: 1 065

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-11-20 13:21 UTC

This package is auto-updated.

Last update: 2026-11-20 13:21:28 UTC


README

Tests PHP 8.3–8.6 PHPStan License

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/framework owns 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.