PHP code example of designbycode / laravel-business-name-generator

1. Go to this page and download the library: Download designbycode/laravel-business-name-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

designbycode / laravel-business-name-generator example snippets


return [
];

use Designbycode\LaravelBusinessNameGenerator\Facades\BusinessNameGenerator;
$businessName = BusinessNameGenerator::generate()->first();
 
$customAdjectives = ["Cool", "Amazing", "Super"];
$customNouns = ["Shop", "Hub", "Center"];

$generator = BusinessNameGenerator::generate($customAdjectives, $customNouns)->first();
echo $businessName;  // Example output: "Super Shop"
 
// Generate a business name using playful adjectives and color-related nouns
$businessName = BusinessNameGenerator::generate('playful', 'color')->first();
echo $businessName;  // Example output: "Cheerful Blue"

// Generate a business name using playful adjectives and color-related nouns
$businessName = BusinessNameGenerator::amount(2)->generate()->get();
echo $businessName;  // Example output: ["Cheerful Blue", "Red Trading]
 
namespace YourNamespace;

use Designbycode\BusinessNameGenerator\HasGeneratorLists;

class CustomAdjectives implements HasGeneratorLists
{
    public function default(): array
    {
        return ["Energetic", "Bold", "Brilliant"];
    }

    public function funny(): array
    {
        return ["Zany", "Wacky", "Goofy"];
    }

    public function playful(): array
    {
        return ["Bouncy", "Jovial", "Perky"];
    }

    public function color(): array
    {
        return ["Crimson", "Amber", "Sapphire"];
    }
}


use Designbycode\BusinessNameGenerator\BusinessNameGenerator;
use YourNamespace\CustomAdjectives;
use Designbycode\BusinessNameGenerator\Nouns;

$generator = BusinessNameGenerator::generate((new CustomAdjectives())->default(), (new Nouns())->default());

$businessName = BusinessNameGenerator::generate('default', 'default');
echo $businessName;  // Example output: "Energetic Solutions"