Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Faker

Security covered Under active development 5 sites

This module integrates the PHP Faker library to generate realistic sample content for your Drupal site. It works with Devel Generate to easily create fake but believable names, addresses, emails, and other data, making your sample content more meaningful.

Use the PHP Faker library to generate more meaningful sample content.

Devel Generate is great for creating a lot of sample content in a hurry, but sometimes you want samples that are more meaningful, or closer to the content you expect users to generate. This is where Faker comes in.

This module has no hard dependency on Devel Generate, but to benefit from all the features you will have to enable both.

Faker is a PHP library that generates fake data for you

Faker (the library) can generate real looking names, addresses, emails, domains and more. Faker (the module) combines the library with quick content creation abilities provided by Devel Generate, to give you the power to easily generate real looking sample content.

GitHub mirror: https://github.com/baikho/drupal-faker

Relevant modules

  • Devel - See its submodule "Devel Generate"

Drupal 7

Installation w/ Drush make

The module includes a Drush make file that will automatically download the necessary library when installing via Drush make. Just add faker to your project's Drush make file.

Manual installation

Usage

  • Implement hook_faker_node_generate() from your module/feature. See faker.api.inc in the source for more info about the available hooks.
  • Run devel generate either from drush or the admin UI.

Examples

function hook_faker_node_generate($node, $faker) {
  if ($node->type === 'bio') {
    $node->title = $faker->name;
    $node->field_email[LANGUAGE_NONE][0]['value'] = $faker->email;
    $node->field_phone[LANGUAGE_NONE][0]['value'] = $faker->phoneNumber;
  }
}

Drupal 8+

Installation

Just install as you would via composer and it will download the relevant Faker package.

Features

The 8.x-2.x and 3.x versions add "Faker Profile" config entities, that are out of the box available for use with the Devel Generate "Generate" tasks.

D8 Integration Demo

Ask your assistant about Faker

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Jun 2023
Latest release
7 months ago
Releases (12 mo)
2
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
3.1.0-beta1 Pre-release 9–10 Mar 1, 2026
3.1.x-dev Dev 9–10 Mar 1, 2026
3.0.0-beta2 Pre-release 9–10 Feb 8, 2025
3.0.0-beta1 Pre-release 9–10 Jan 19, 2025
3.0.x-dev Dev 9–10 Jun 13, 2023