PHPackages                             goez/laravel-fakedown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. goez/laravel-fakedown

ActiveLibrary[Testing &amp; Quality](/categories/testing)

goez/laravel-fakedown
=====================

A Laravel package for generating fake Markdown content

0.2.0(11mo ago)0470MITPHPPHP ^8.2CI passing

Since Jun 13Pushed 11mo agoCompare

[ Source](https://github.com/goez-tools/laravel-fakedown)[ Packagist](https://packagist.org/packages/goez/laravel-fakedown)[ RSS](/packages/goez-laravel-fakedown/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (4)Used By (0)

Laravel Fakedown
================

[](#laravel-fakedown)

[![Latest Version on Packagist](https://camo.githubusercontent.com/618ad0a718e05d12c97d42ad5b80ea2bc8e29f74e6b108cbdd38fc4df0b671e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f657a2f6c61726176656c2d66616b65646f776e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/goez/laravel-fakedown)[![GitHub Tests Action Status](https://camo.githubusercontent.com/88199fd59b408e21c6f5bff7574fb9b917c29e6f550c668c7138c0355e6d2725/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676f657a2d746f6f6c732f6c61726176656c2d66616b65646f776e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/goez-tools/laravel-fakedown/actions/workflows/run-tests.yml)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/eadca8e569507f1c7e179141657300d4e7083430164c3c4b8a1cb84e530e9da7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676f657a2d746f6f6c732f6c61726176656c2d66616b65646f776e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/goez-tools/laravel-fakedown/actions/workflows/fix-php-code-style-issues.yml)[![Total Installs](https://camo.githubusercontent.com/f4f04cbfad23044ed2a2ace9a4e641b7ee693f6eb2826bef7faf03da9b9f8b81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f657a2f6c61726176656c2d66616b65646f776e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/goez/laravel-fakedown)

Laravel Fakedown is a Laravel package that generates fake Markdown content, perfect for testing, prototyping, or content placeholders.

Features
--------

[](#features)

- 🚀 **Easy to Use**: Generate rich Markdown content with just a few lines of code
- 🌍 **Multi-language Support**: Traditional Chinese, Simplified Chinese, English, Japanese
- 🎨 **Multiple Styles**: Professional, casual, technical styles, plus domain-specific styles for music, art, technology, gaming, sports, travel, food, health, education, business, and software development
- 📝 **Rich Formatting**: Headings, paragraphs, lists, code blocks, tables, blockquotes, links, images
- ⚡ **Artisan Commands**: Convenient command-line tools
- 🔧 **Faker Integration**: Use in data seeding, Factory, Seeder
- 📝 **Highly Customizable**: Customize content length, language, and structure
- 🧪 **Complete Testing**: Unit and integration tests

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.0 or higher (including Laravel 12.x and future versions)

Installation
------------

[](#installation)

```
composer require goez/laravel-fakedown
```

### Publishing Configuration Files (Optional)

[](#publishing-configuration-files-optional)

```
# Publish main configuration file
php artisan vendor:publish --tag=fakedown-config

# Publish template configuration file
php artisan vendor:publish --tag=fakedown-templates

# Publish all configuration files
php artisan vendor:publish --tag=fakedown-all

# Or use provider name
php artisan vendor:publish --provider="Goez\LaravelFakedown\FakedownServiceProvider"
```

#### Configuration File Description

[](#configuration-file-description)

- **`config/fakedown.php`**: Main configuration file containing basic settings like language, length, style
- **`config/fakedown-templates.php`**: Template content file containing all language and style template data

#### Usage Recommendations

[](#usage-recommendations)

- If you only need to adjust basic settings (like default language, length), just publish `fakedown-config`
- If you need to customize template content or add styles, publish `fakedown-templates`
- For first-time use, recommended to publish all files: `--tag=fakedown-all`

Basic Usage
-----------

[](#basic-usage)

### 1. Using Facade

[](#1-using-facade)

```
use Goez\LaravelFakedown\Facades\Fakedown;

// Generate basic Markdown content
$markdown = Fakedown::generate();

// Generate content with specific language, length and style
$markdown = Fakedown::generate([
    'language' => 'en',
    'length' => 5,
    'style' => 'music'  // Music style
]);

// Supported styles
$styles = [
    'professional',  // Professional style
    'casual',       // Casual style
    'technical',    // Technical style
    'music',        // Music style
    'art',          // Art style
    'technology',   // Technology style
    'gaming',       // Gaming style
    'sports',       // Sports style
    'travel',       // Travel style
    'food',         // Food style
    'health',       // Health style
    'education',    // Education style
    'business',     // Business style
    'software'      // Software development style
];

// Generate specific elements
$heading = Fakedown::heading(1, 'en');
$paragraph = Fakedown::paragraph('en');
$list = Fakedown::list();
$codeBlock = Fakedown::codeBlock();
$table = Fakedown::table();
$title = Fakedown::title('en', 'professional');  // Generate unique title
```

### 2. Dependency Injection

[](#2-dependency-injection)

```
use Goez\LaravelFakedown\FakedownGenerator;

class DocumentController extends Controller
{
    public function generateSample(FakedownGenerator $fakedown)
    {
        $content = $fakedown->generate([
            'language' => 'en',
            'length' => 3,
            'style' => 'technology',  // Technology style
            'structure' => [
                'enable_headings' => true,
                'enable_lists' => true,
                'enable_code_blocks' => false,
                'enable_tables' => true,
                'enable_blockquotes' => true,
                'enable_links' => true,
                'enable_images' => false,
            ]
        ]);

        return view('document', compact('content'));
    }
}
```

### 3. Faker Provider

[](#3-faker-provider)

```
use Faker\Factory;

$faker = Factory::create();
$faker->addProvider(new \Goez\LaravelFakedown\FakedownProvider($faker));

// Use in Factory or Seeder
$markdown = $faker->markdown(['language' => 'en', 'length' => 4]);
$heading = $faker->markdownHeading(2, 'en');
$paragraph = $faker->markdownParagraph('ja');
$list = $faker->markdownList();
$codeBlock = $faker->markdownCodeBlock();
$table = $faker->markdownTable();
$title = $faker->markdownTitle('en', 'professional');  // Generate unique title
```

### 4. Using in Model Factory

[](#4-using-in-model-factory)

```
// database/factories/PostFactory.php
use Goez\LaravelFakedown\Facades\Fakedown;

class PostFactory extends Factory
{
    public function definition(): array
    {
        return [
            'title' => fake()->sentence(),
            'content' => Fakedown::generate([
                'language' => 'en',
                'length' => fake()->numberBetween(3, 8)
            ]),
            'excerpt' => Fakedown::paragraph('en'),
        ];
    }
}
```

Configuration
-------------

[](#configuration)

After publishing configuration files, you can customize settings in `config/fakedown.php`:

```
return [
    // Default language
    'default_language' => 'en',

    // Default content length
    'default_length' => 3,

    // Default style
    'default_style' => 'professional',

    // Template configuration file path
    'templates_file' => config_path('fakedown-templates.php'),

    // Structure settings
    'structure' => [
        'enable_headings' => true,
        'enable_lists' => true,
        'enable_code_blocks' => true,
        'enable_tables' => true,
        'enable_blockquotes' => true,
        'enable_links' => true,
        'enable_images' => true,
    ],
];
```

Supported Languages
-------------------

[](#supported-languages)

- `zh-tw` - Traditional Chinese
- `zh-cn` - Simplified Chinese
- `en` - English
- `ja` - Japanese

Supported Elements
------------------

[](#supported-elements)

- Headings (H1-H6)
- Paragraphs
- Unordered lists
- Code blocks
- Tables
- Blockquotes
- Links
- Images

Artisan Commands
----------------

[](#artisan-commands)

Quickly generate Markdown content:

```
# Basic usage
php artisan fakedown:generate

# Specify language, length and style
php artisan fakedown:generate --language=en --length=5 --style=music

# Output to file
php artisan fakedown:generate --output=storage/sample.md --style=technology

# Disable specific elements
php artisan fakedown:generate --no-code --no-images --no-tables

# Complete example
php artisan fakedown:generate \
    --language=en \
    --length=10 \
    --style=art \
    --output=docs/sample.md \
    --no-images
```

### Command Options

[](#command-options)

- `--language` : Specify language (zh-tw, zh-cn, en, ja)
- `--length` : Specify number of sections
- `--style` : Specify style (professional, casual, technical, music, art, technology, gaming, sports, travel, food, health, education, business, software)
- `--output` : Output file path
- `--no-headings` : Disable headings
- `--no-lists` : Disable lists
- `--no-code` : Disable code blocks
- `--no-tables` : Disable tables
- `--no-blockquotes` : Disable blockquotes
- `--no-links` : Disable links
- `--no-images` : Disable images
- `--no-lists` : Disable lists
- `--no-code` : Disable code blocks
- `--no-tables` : Disable tables
- `--no-blockquotes` : Disable blockquotes
- `--no-links` : Disable links
- `--no-images` : Disable images

Title Generator Feature
-----------------------

[](#title-generator-feature)

Laravel Fakedown provides a powerful title generator that creates unique and coherent titles.

### Features

[](#features-1)

- **Uniqueness Guarantee**: Each generated title is unique and won't be repeated
- **Multiple Combination Patterns**: Uses various word combinations including prefixes, subjects, objects, and suffixes
- **Smart Connections**: Automatically selects appropriate connectors to ensure title fluency
- **Style Support**: Supports different styles for title generation
- **Cache Management**: Built-in cache mechanism with the ability to clear generated title records

### Basic Usage

[](#basic-usage-1)

```
use Goez\LaravelFakedown\Facades\Fakedown;

// Generate a single title
$title = Fakedown::title();
echo $title; // e.g., "Deep Analysis of Frontend Development Best Practices"

// Specify language and style
$title = Fakedown::title('en', 'professional');

// Generate multiple unique titles
for ($i = 0; $i < 5; $i++) {
    echo Fakedown::title() . "\n";
}
```

### Advanced Features

[](#advanced-features)

```
use Goez\LaravelFakedown\FakedownGenerator;

$generator = new FakedownGenerator();

// Generate titles and check cache
$title1 = $generator->title();
$title2 = $generator->title();

// View generated titles
$generatedTitles = $generator->getGeneratedTitles();
echo "Generated " . count($generatedTitles) . " titles\n";

// Clear title cache
$generator->clearTitleCache();

// Generate new title after clearing (may repeat previous titles)
$newTitle = $generator->title();
```

### Title Combination Patterns

[](#title-combination-patterns)

The title generator uses the following combination patterns:

1. **Prefix + Subject**: Deep Analysis + Frontend Development
2. **Subject + Object**: Frontend Development + Best Practices
3. **Prefix + Subject + Suffix**: Deep Analysis + Frontend Development + Complete Manual
4. **Subject + Object + Suffix**: Frontend Development + Best Practices + Practical Guide
5. **Prefix + Object**: Deep Analysis + Best Practices
6. **Object + Suffix**: Best Practices + Practical Guide

### Connection Modes

[](#connection-modes)

The system intelligently selects different connection methods:

- Direct connection: `DeepAnalysisFrontendDevelopment`
- Colon connection: `Deep Analysis: Frontend Development`
- "of" connection: `Deep Analysis of Frontend Development`
- "and" connection: `Frontend Development and Best Practices`
- Dash connection: `Deep Analysis - Frontend Development`

### Using in Faker Provider

[](#using-in-faker-provider)

```
use Faker\Factory;

$faker = Factory::create();
$faker->addProvider(new \Goez\LaravelFakedown\FakedownProvider($faker));

$title = $faker->markdownTitle('en', 'professional');
```

Advanced Examples
-----------------

[](#advanced-examples)

### Generate Blog Articles

[](#generate-blog-articles)

```
$article = Fakedown::generate([
    'language' => 'en',
    'length' => 6,
    'structure' => [
        'enable_headings' => true,
        'enable_lists' => true,
        'enable_code_blocks' => true,
        'enable_tables' => false,
        'enable_blockquotes' => true,
        'enable_links' => true,
        'enable_images' => true,
    ]
]);
```

### Generate Technical Documentation

[](#generate-technical-documentation)

```
$documentation = Fakedown::generate([
    'language' => 'en',
    'length' => 10,
    'structure' => [
        'enable_headings' => true,
        'enable_lists' => true,
        'enable_code_blocks' => true,
        'enable_tables' => true,
        'enable_blockquotes' => false,
        'enable_links' => true,
        'enable_images' => false,
    ]
]);
```

Development
-----------

[](#development)

### Common Commands

[](#common-commands)

```
# Install dependencies
composer install

# Run tests
composer test
vendor/bin/phpunit

# Check code style
composer format-test
composer lint

# Auto-fix code style
composer format

# Run examples
php examples/basic_usage.php

# Test coverage
composer test-coverage
```

### Todo List

[](#todo-list)

- Add more language support
- Support custom templates
- Add Markdown output validation
- Performance optimization
- More content types (math formulas, flowcharts, etc.)

Testing
-------

[](#testing)

```
composer test
```

Code Style
----------

[](#code-style)

This project uses [Laravel Pint](https://laravel.com/docs/pint) for code formatting:

```
# Check code style
composer format-test
composer lint

# Auto-fix code style
composer format
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

MIT License. See [License File](LICENSE.md) for details.

Documentation Languages
-----------------------

[](#documentation-languages)

- [English](README.md) (Current)
- [正體中文](README.zh-TW.md)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance52

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

333d ago

PHP version history (2 changes)0.0.1PHP ^8.1

0.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/000012ed8f10873694d29e2f60b7b71171c088d6fd655a695210dd2fe46172b9?d=identicon)[jaceju](/maintainers/jaceju)

---

Tags

testinglaravelfakermarkdownFake data

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/goez-laravel-fakedown/health.svg)

```
[![Health](https://phpackages.com/badges/goez-laravel-fakedown/health.svg)](https://phpackages.com/packages/goez-laravel-fakedown)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[orchestra/workbench

Workbench Companion for Laravel Packages Development

8017.0M43](/packages/orchestra-workbench)[travoltron/dusk-secure

A more secure Laravel Dusk that provides simple end-to-end testing and browser automation without exposing routes or authentication.

371.9k](/packages/travoltron-dusk-secure)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
