Hook: widget.render.output
Last updated on May 21, 2026 05:06
Overview
Type: Filter
Location: app/Services/WidgetManager.php
Filters rendered HTML of a single widget instance. Use to wrap widgets in custom markup or conditionally hide them.
Parameters
| Param | Type | Description |
|---|---|---|
$html |
string | Rendered widget HTML |
$instance |
object | Widget instance data |
Return
Must return string.
Usage Example
Hook::addFilter('widget.render.output', function (string $html, $instance) {
return '<div class="widget-wrapper card shadow-sm">' . $html . '</div>';
});