rokka/client
Official PHP client for Rokka, the image processing and delivery service. Upload, store, and manage images, generate dynamic URLs with stack options, and integrate Rokka into PHP or Laravel apps through a simple, PSR-compatible API.
rokka/client remains a thin official PHP API client for Rokka.io, not a Laravel package, and still fits as an infrastructure adapter around an external image-processing/CDN service. Release 1.22.0 significantly widens the surface area of that adapter — aliasing, source-image renaming, cache purging, ZIP export, user metadata, stack-option introspection, server-side URL signing, billing, and organization options — which makes Rokka more viable as a full media-lifecycle backend rather than just a render-URL generator. It is a worse fit if we only need simple resizing, since the wrapper now has more capability to (selectively) expose.ImageTransformer-style contract), but the wrapper's scope grows. The new alias model (SourceImageAlias) and alias CRUD imply a mapping/naming convention we must own in application config. listStackOptions can drive validation of stack option payloads; getUserMetadata/getUserMetadataField enables metadata-driven logic but needs a caching and typing layer. No auto-discovery, facade, or Laravel config exists in 1.22.0. The PoC must now also cover alias lifecycle, cache purge, and ZIP download against a non-production org.copySourceImage, getSourceImagesWithBinaryHash) to documented routes, and modernizes the toolchain (PHPUnit 11). The offsetting risks are now breaking platform constraints: PHP 8.0/8.1 support and Guzzle 6 are dropped (requires PHP ^8.2, guzzlehttp/guzzle ^7.4.5, guzzlehttp/psr7 ^2.4.5). This can collide with older Laravel applications and with other packages pinning Guzzle 6 or PSR-7 v1. Additional risks: destructive operations (deleteSourceImageCache, deleteStackCache with *) are one config typo from a full-org purge and are paid features; keepHash creates deliberate cache-coherence risk; signUrlOnServer adds a network round-trip where local UriHelper::signUrl() would do.keepHash from shipping stale renders to users? Which PHP/Laravel versions must our wrapper support, and does dropping PHP 8.1 force an upgrade elsewhere?RokkaConfig/policy layer that whitelists which API methods the application may call — critically, restrict cache-purge, rename, and billing calls to privileged services rather than exposing them broadly. Do not leak Rokka concepts (aliases, stack options, hashes) into controllers or Blade; expose view models/helpers for URLs.copySourceImage, getSourceImagesWithBinaryHash) are behavior-preserving, so no call-site changes are required — but verify by contract test.guzzlehttp/guzzle ^7.4.5, guzzlehttp/psr7 ^2.4.5, and that no transitive dependency pins Guzzle 6 or PSR-7 v1. Check Laravel version compatibility: Laravel 10 on PHP 8.1 is blocked by this release, so an app upgrade may be a prerequisite. Pin the client version in composer.json (caret constraint plus lockfile), and run composer why-not/conflict checks in CI. Add mocked-client unit tests plus opt-in contract tests against a non-production Rokka org; verify CDN URL patterns, alias resolution, and purge propagation.* org-wide purge), ZIP download for large asset sets, and metadata schema expectations. Notify the team that signUrlOnServer exists but is usually the wrong choice versus local signing — document the decision to prevent accidental latency.keepHash — metadata updates won't bump hashes, so browsers and CDNs serve old images until manual invalidation; accidental org-wide cache purge via deleteStackCache('*'); alias collisions or dangling aliases after rename/delete; LogicException from passing both keepHash and deletePrevious. Mitigate with authorization and confirmation guards on destructive calls, retries/backoff, circuit breaking, health checks, placeholder/original-image fallback, and alerting on error rates and quota.How can I help you explore Laravel packages today?