victoire/cover-widget
A cover image widget for Laravel that lets you attach, manage, and render cover images on your models. Includes upload handling, crop presets, and Blade helpers for responsive output, so adding hero or thumbnail covers to any resource takes just a few lines of code.
This is a Symfony bundle (not Laravel) — a widget plugin for the Victoire CMS. It renders a full-width "cover" block (background image + title/subtitle/CTA) that editors drop into pages from Victoire's front-end editor. Because it has zero dependents and its last release was April 2019, treat it as a reference implementation rather than a maintained dependency.
Minimal steps:
composer require victoire/cover-widget
AppKernel::registerBundles() (Symfony ≤3.4) or config/bundles.php (Symfony 4):
new Victoire\Widget\CoverBundle\VictoireWidgetCoverBundle(),
bin/console cache:clear
Where to look first:
src/Widget/CoverWidget.php — the widget class: getName(), getCategory(), and the form fields it exposes (image, title, subtitle, link/CTA, CSS class).Resources/views/Widget/ — the Twig template that actually renders the block.Resources/config/ — service definitions and any widget registration metadata.composer.json — pin the Victoire core version it was tested against; this is the single biggest compatibility signal.First use case: a marketing/homepage hero block. Drop a Cover into a page layout, upload a background image, set a title and CTA link, publish, and verify the front-end rendering.
Editor-first usage. The intended workflow is almost entirely through Victoire's WYSIWYG editor — you configure the widget via its auto-generated form and rarely touch PHP. For day-to-day work, that means your job is theming and template overrides, not business logic.
Overriding the template. Standard Symfony bundle-override convention: copy Resources/views/Widget/cover.html.twig into app/Resources/VictoireWidgetCoverBundle/views/Widget/cover.html.twig (Symfony 3) or templates/bundles/VictoireWidgetCoverBundle/... (Symfony 4). Change markup and CSS classes there instead of forking the bundle.
Extending the widget with extra fields. Subclass CoverWidget (or copy it), add a form field in the widget's buildForm, persist it through the widget's business entity, and update the template. Register your subclass as the widget Victoire resolves for the cover name so the editor keeps working.
Programmatic rendering. When you already have a widget instance (e.g. seeded from a fixture, or fetched from WidgetRepository), render it with the registered template rather than reimplementing the markup:
{{ render_widget(coverWidget) }}
or include the bundle template directly and pass the same variables the widget exposes. Prefer this over hard-coding HTML so editor changes and template overrides stay in sync.
Theming / asset pipeline. Cover images typically go through Victoire's/your app's image resolver (LiipImagine or similar). Wire the thumbnail/full-size filters in config and reference them from the overridden template; don't hard-code raw upload paths.
Migration from a Symfony app. If you're porting this concept to Laravel, the closest analogue is a Blade component (<x-cover :image :title :cta />) backed by a database row for page blocks — the bundle's real value is its field schema and template structure, not its code.
composer why-not check against your Victoire core before committing.WidgetBundle model, AbstractWidget, editor JS, and asset handling are present. Any attempt to use it outside Victoire (let alone Laravel/Symfony without the CMS) will fail at container build time.bin/console cache:clear) and often hard-refresh the editor. If a widget is missing from the picker, check the bundle registration and cache before anything else.app/Resources/<BundleName>/views/...; Symfony 4 uses templates/bundles/<BundleName>/.... Wrong path = silent fallback to the bundle's template, which looks like "my changes don't apply."victoire/cover-widget but the PHP bundle is VictoireWidgetCoverBundle. Use the bundle name for the override directory and container registration, the package name for composer.loading="lazy" in your override; otherwise you ship a multi-MB hero on every page.vendor/. Keep your version as a path/VCS Composer dependency so it survives composer update.How can I help you explore Laravel packages today?