Skip to content

Releases: awcodes/content-faker

v1.2.0

Choose a tag to compare

@awcodes awcodes released this 23 Sep 19:31
4ff51e7

What's changed

Seeded output is now fully reproducible

Seeding Faker now reproduces the output exactly, including where inline decorations (bold, italic, code, links) land. Before this release, decoration positions used random_int(), which ignored the seed. (#8)

fake()->seed(1234);

markdown_faker()->docsPage()->render(); // identical on every run

Bring your own Faker generator

make(), the helpers and a new fluent withFaker() method accept a Faker\Generator. You can use this, for example, to add your own providers:

MarkdownFaker::make($faker)->article()->render();
markdown_faker($faker)->article()->render();
MarkdownFaker::make()->withFaker($faker)->article()->render();

Existing calls are unaffected.

Notes

  • Faker's seed() seeds PHP's process-wide random generator, so seeding any Faker instance affects all of them. Seed immediately before generating the content you want to reproduce.
  • Generated prose comes from Faker's Lorem provider, which no locale overrides. A locale-specific generator still produces Latin text; to change the prose, add a provider that extends Faker\Provider\Lorem with your own $wordList (see the README for an example). Overriding individual methods such as paragraph() isn't enough, because Lorem calls its own methods internally.

Full Changelog: v1.1.0...v1.2.0

v1.1.0

Choose a tag to compare

@awcodes awcodes released this 23 Sep 19:12
066ea82

What's changed

RichEditorFaker now renders merge tags as Filament merge tag nodes, <span data-type="mergeTag" data-id="key"></span>, so Filament's RichContentRenderer fills them with the values passed to mergeTags(). Before this release, tags were plain {{ key }} text, which Filament shows literally. This affects mergeTag(), paragraphWithMergeTags(), headingWithMergeTags() and docsPage(). (#7)

⚠️ Default output change

Merge tags are no longer rendered as {{ key }} by default. To keep the previous output, publish the config and set:

'rich_editor' => [
    'merge_tag_format' => 'text',
],

Filament merge tags have no fallback, so mergeTag()'s $fallback argument only applies in the text format.

Full Changelog: v1.0.0...v1.1.0

v1.0.0

Choose a tag to compare

@awcodes awcodes released this 24 Jun 21:08