krafthaus / name-generator by jspekken

Name generator for your next Laravel project.
693
2
2
Package Data
Maintainer Username: jspekken
Maintainer Contact: jspekken@gmail.com (Jelle Spekken)
Package Create Date: 2017-03-09
Package Last Update: 2017-03-10
Language: PHP
License: MIT
Last Refreshed: 2024-11-19 03:15:51
Package Statistics
Total Downloads: 693
Monthly Downloads: 6
Daily Downloads: 0
Total Stars: 2
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Name Generator for Laravel

Total Downloads Build Status License StyleCI

Installation

Add name-generator to your composer.json file:

"require": {
    "krafthaus/name-generator": "^1.0"
}

Use composer to install the package:

$ composer update

Register the package:

'providers' => [
    // ...
    KraftHaus\NameGenerator\NameGeneratorServiceProvider::class,
]

Publish the configuration files:

$ php artisan vendor:publish --provider="KraftHaus\NameGenerator\NameGeneratorServiceProvider" --tag=config

Usage

Generate a string of random words:

$words = KraftHaus\NameGenerator\Facades\Generator::generate();
// output: word1 word2

// Or define the amount of words you'd like to output:
$words = KraftHaus\NameGenerator\Facades\Generator::generate(5);
// output: word1 word2 word3 word4 word5

// With the glue parameter:
$words = KraftHaus\NameGenerator\Facades\Generator::generate(3, '-');
// output: word1-word2-word3

Generate an array of random words:

$words = KraftHaus\NameGenerator\Facades\Generator::raw();
// output: ['word1', 'word2'];

// Or define the amount of words you'd like to output:
$words = KraftHaus\NameGenerator\Facades\Generator::raw(4);
// output: ['word1', 'word2', 'word3', 'word4'];

License

This package is available under the MIT license.

Copyright (c) 2017 KraftHaus