New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

jacksleight/statamic-bard-mutator

Modify the data and tags rendered by the Bard fieldtype, giving you full control over the final HTML.
184,491 27

Larablocks Analysis

jacksleight/statamic-bard-mutator works with Laravel 12 and 13 (latest release 3.0.6, Nov 2, 2026).

Recommendation checks

Solid choice

Solid choice: maintained and up to date, meets 3 of 4 checks; below the bar for Recommended on use.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Nov 2, 2026)
  • 46,433 downloads a month (at least 10,000)
  • 27 GitHub stars (needs 100)

State

Maintained
  • Last stable release: Nov 2, 2026.
  • 1 release in the last 12 months.
  • First released: Sep 23, 2021.
  • Monthly downloads: 46,433.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.

Install
composer require jacksleight/statamic-bard-mutator
Latest Version:3.0.6
Laravel:12 · 13
License:MIT
Last Updated:Nov 2, 2026
Links: GitHub  ·  Packagist
Maintainer: jacksleight

Bard Mutator

This Statamic addon allows you to modify the data and tags rendered by the Bard fieldtype, giving you full control over the final HTML. You can add, remove and modify attributes, wrap tags and content, or rename and replace tags entirely. You can also make changes to the raw data before anything is rendered to HTML.

Examples

Here are a few examples of what's possible. For more information and more examples check the documentation.

use JackSleight\StatamicBardMutator\Facades\Mutator;
use Statamic\Facades\URL;

Mutator::html('link', function ($value) {
    if (URL::isExternal($value[1]['href'])) {
        $value[1]['class'] = 'external';
    }
    return $value;
});

Add an auto-generated ID to all level 2 headings

use Illuminate\Support\Str;
use JackSleight\StatamicBardMutator\Facades\Mutator;

Mutator::html('heading', function ($value, $item) {
    if ($item->attrs->level === 2) {
        $value[1]['id'] = Str::slug(collect($item->content)->implode('text', ''));
    }
    return $value;
});
use Illuminate\Support\Str;
use JackSleight\StatamicBardMutator\Facades\Mutator;
use JackSleight\StatamicBardMutator\Support\Data;

Mutator::data('heading', function ($item) {
    $slug = Str::slug(collect($item->content)->implode('text', ''));
    array_unshift(
        $item->content,
        Data::html('<a id="'.$slug.'" href="#'.$slug.'">#</a>')
    );
});

Documentation

Statamic Bard Mutator Documentation

Compatibility

In order to give you access to the Tiptap rendering process Bard Mutator has to replace Statamic's built-in Tiptap extensions with its own. It can only do that reliably if there are no other addons (or user code) trying to do the same thing. To help minimise incompatibilities Bard Mutator will only replace the extensions for types that have plugins.

Sponsoring

This addon is completely free to use. However fixing bugs, adding features and helping users takes time and effort. If you find this addon useful and would like to support its development any contribution would be greatly appreciated. Thanks! 🙂

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released License
3.0.6 MIT
3.0.5
3.0.4
3.0.3
3.0.2