Repository navigation
Releases: awcodes/content-faker
Release list
v1.2.0
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 runBring 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
Loremprovider, which no locale overrides. A locale-specific generator still produces Latin text; to change the prose, add a provider that extendsFaker\Provider\Loremwith your own$wordList(see the README for an example). Overriding individual methods such asparagraph()isn't enough, becauseLoremcalls its own methods internally.
Full Changelog: v1.1.0...v1.2.0
v1.1.0
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
Full Changelog: https://github.com/awcodes/content-faker/commits/v1.0.0