Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Statamic Placeholders

Statamic Placeholders Laravel Package

daun/statamic-placeholders

Statamic Placeholders lets you use dynamic placeholders in your Antlers templates, replacing them with values from entries, config, or custom resolvers. A lightweight addon for cleaner, more flexible content.

View on GitHub
Deep Wiki
Context7

Generate image placeholders of Statamic assets for smoother lazyloading

Frequently asked questions about Statamic Placeholders
What is daun/statamic-placeholders used for?
Statamic Placeholders is a Laravel/Statamic addon for defining reusable placeholders centrally and resolving them throughout your Statamic content and Antlers templates. Depending on your configuration, placeholders can keep repeated copy, links, and small dynamic snippets DRY, and the 5.x line also addresses generated placeholder output such as data URIs. The package is lightweight and fits into normal Statamic rendering workflows.
How do I install daun/statamic-placeholders with Composer?
Install it with Composer in the Laravel application that runs Statamic, using composer require daun/statamic-placeholders. Follow the package's publish and configuration steps for your Statamic version, then clear the relevant caches. Because it is a Statamic addon, it belongs in the Statamic site itself rather than in a standalone Laravel package.
How do I use placeholders in Antlers templates and content?
You reference placeholders in Antlers templates and content after defining them in the package's central configuration or resolver layer. The exact syntax depends on the resolver you choose, so document placeholder names for editors and keep them consistent across templates. The point is to avoid hard-coding the same copy or links in multiple places.
Can I resolve placeholders from entries, config, or custom resolvers?
Yes, the package is described as resolving placeholders from entries, config, or custom resolvers. That lets you keep shared values in one place while pulling dynamic data from your Statamic content model. For custom resolvers, keep the logic deterministic and cover it with tests so rendered output stays predictable.
Which Laravel and Statamic versions are supported?
The package is intended for Laravel applications running Statamic, but the provided material does not list exact version constraints. Review the composer.json requirements for the release you plan to install, especially when moving from 4.x to 5.x. Pin the package version in production and confirm compatibility with your PHP, Laravel, and Statamic versions before deploying.
What changed in Statamic Placeholders 5.0.0?
Version 5.0.0 is a major release with application-facing output changes rather than only dependency updates. The notable changes include a WebP placeholder format default, support for custom Intervention drivers such as libvips, and placeholder generation de-duplication. Treat the upgrade as a render-time contract review, not a routine composer update.
Is the WebP placeholder default safe for emails, PDFs, and older clients?
The WebP default is explicitly labeled breaking, so any consumer that assumed a stable placeholder MIME type or byte-identical output needs attention. Modern browsers handle WebP image sources well, but desktop Outlook, some PDF renderers, older Safari, and third-party services that ingest data URIs may not accept it. Test those rendering surfaces before rolling 5.0.0 out broadly.
Does Statamic Placeholders support libvips and custom Intervention drivers?
Yes, 5.0.0 adds support for custom Intervention drivers, with libvips as a notable example. This is opt-in capability rather than a required migration, and it introduces a system-level dependency plus a different output profile from GD or Imagick. If you adopt it, standardize the driver across development, CI, and production to avoid divergent placeholder output.
How does placeholder de-duplication affect caching in production?
De-duplication is intended as a performance and caching optimization, but it raises cache invalidation questions. Make sure the cache key includes everything that affects the placeholder, such as dimensions, format, source identifier, and package version. Otherwise, previously cached pre-5.0 placeholders may be reused after the upgrade.
How should I test and maintain a Statamic Placeholders upgrade?
Add contract tests or visual snapshot checks for rendered placeholder output, especially if placeholders appear in HTML, JSON, emails, PDFs, or feeds. Test with the same driver, image library, and configuration you use in production, and review composer.json constraints before upgrading. Keep the package pinned and monitor the 5.x branch for fixes, since that is the branch receiving new features.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle