replworks/laravel-imageforge
Laravel ImageForge offers a fluent image manipulation API for Laravel apps, making it easy to resize, crop, optimize, and cache images. Generate thumbnails and apply transformations with clean, chainable methods.
laravel-imageforge is a Blade-friendly image manipulation package: you point it at a source image, describe the transform (resize/crop/format), and it returns a URL to a cached, generated derivative.
composer require replworks/laravel-imageforge
php artisan vendor:publish --tag="imageforge-config"
config/imageforge.php first — it defines the source disk, the cache/output disk, the default driver (GD vs Imagick) and the URL prefix used to serve derivatives. Most "it doesn't work" reports are disk/path misconfiguration here.php artisan storage:link) if derivatives are written to public.Look at the service provider's Blade directive registration and the config file before reading the transform classes — that tells you the directive signature and the defaults that apply when you omit arguments.
src/srcset attributes so templates stay declarative, and keep the transform description inline (width/height/fit/format) so a designer can read intent from the template.srcset (e.g. 320/640/1280 widths) is cheap after warm-up — one directive call per width.Storage::fake() plus an assertion that the derivative file exists after the first render is a solid smoke test for your integration, and it catches config drift early.@php(...) in the same template (and, on the evidence of the fix, inline directive usage generally) caused the compiled output to swallow the remainder of the file. The symptom is nasty and non-obvious: the page renders correctly up to the directive and then everything after it disappears — no exception, no log entry. If you're on 2.0.0/2.0.1 and see truncated layouts, this is the cause, not your template.storage/framework/views; grepping there for the emitted PHP is the fastest way to tell a directive-compilation problem (malformed PHP, missing statement terminator) from a runtime/image problem. Clear with php artisan view:clear after upgrading — stale compiled views survive composer updates.storage:link. Generated derivatives are written at runtime by the web user. A storage/ directory owned by your deploy user with restrictive umask produces silent 404s on the derivative URL while the page itself renders fine.{{ }}, not {!! !!}) and avoid hand-concatenating query strings onto it, or you'll break the transform signature and regenerate on every request.How can I help you explore Laravel packages today?