PHPackages                             awcodes/html-faker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. awcodes/html-faker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

awcodes/html-faker
==================

A better html faker.

v0.4.0(11mo ago)113.4k↑12.4%22MITPHPPHP ^8.1CI passing

Since Aug 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/awcodes/html-faker)[ Packagist](https://packagist.org/packages/awcodes/html-faker)[ Docs](https://github.com/awcodes/faker-html)[ RSS](/packages/awcodes-html-faker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (13)Versions (7)Used By (2)

Html Faker
==========

[](#html-faker)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f384f3f67c70743ac251d9eec72ec23cc2e5b7ccf93a03697ee821bfd76aae4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6177636f6465732f66616b65722d68746d6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/awcodes/faker-html)[![Total Downloads](https://camo.githubusercontent.com/f79f3c1cddff86728eb4651a1c6fadc760d6d2def91dab06df72d5e556dd10b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6177636f6465732f66616b65722d68746d6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/awcodes/faker-html)

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

[](#installation)

You can install the package via composer:

```
composer require awcodes/html-faker
```

Usage
-----

[](#usage)

```
use Awcodes\HtmlFaker\HtmlFaker;

HtmlFaker::make()
    ->heading(int | string | null $level = 2)
    ->paragraphs(int $count = 1, bool $withRandomLinks = false)
    ->unorderedList(int $count = 1)
    ->orderedList(int $count = 1)
    ->image(int $width = 640, int $height = 480, string $text = null)
    ->link(string $text = null, string $url = null)
    ->video(?string $provider = 'youtube', ?int $width = 640, ?int $height = 480)
    ->details()
    ->code(string | null $className = 'hljs')
    ->blockquote()
    ->hr()
    ->br()
    ->table()
    ->generate(); //
