Generates random words by combining adjectives and nouns

v1.1.0 2022-03-23 17:28 UTC

This package is auto-updated.

Last update: 2022-09-23 18:37:02 UTC


Latest Version Build Status Quality Score Total Downloads

Word Generator

Generates creative words by randomly combining adjectives and nouns. This is useful for situations in which you need to generate a name that is unique or memorable.


To install the package, run the following command:

composer require claudiodekker/word-generator



use ClaudioDekker\WordGenerator\Generator;

echo Generator::generate(); // Outputs 'autumn firefly', 'crimson meadow', etc.

It's also possible to use a custom separator character, by passing it as the first argument:


use ClaudioDekker\WordGenerator\Generator;

echo Generator::generate('-'); // Outputs 'autumn-firefly', 'crimson-meadow', etc.

Custom Word Lists

It is also possible to override the adjectives and nouns that can be used to generate the random phrases. For example, you may wish to do this if you want to use words that are themed or branded to your project.

To override the adjectives and nouns at the same time, you can pass an array of strings for both the first and second parameter:


use ClaudioDekker\WordGenerator\Generator;

$adjectives = ['adjective one', 'adjective two'];
$nouns = ['noun one', 'noun two'];

Generator::setWordLists($adjectives, $nouns);

If you only wish to override the adjectives, you can use the following:


use ClaudioDekker\WordGenerator\Words\Adjective;

$adjectives = ['adjective one', 'adjective two'];


If you only wish to override the nouns, you can use the following:


use ClaudioDekker\WordGenerator\Words\Noun;

$nouns = ['noun one', 'noun two'];



Please see CHANGELOG for more information what has changed recently.


Please see CONTRIBUTING for details.


If you discover any security related issues, please email instead of using the issue tracker.


The MIT License (MIT). Please see License File for more information.