Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
claudemyburgh committed Jun 8, 2024
1 parent c7e9af5 commit b4c7db5
Showing 1 changed file with 84 additions and 28 deletions.
112 changes: 84 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
# This is my package laravel-business-name-generator
# Laravel Business Name Generator

[![Latest Version on Packagist](https://img.shields.io/packagist/v/designbycode/laravel-business-name-generator.svg?style=flat-square)](https://packagist.org/packages/designbycode/laravel-business-name-generator)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/designbycode/laravel-business-name-generator/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/designbycode/laravel-business-name-generator/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/designbycode/laravel-business-name-generator/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/designbycode/laravel-business-name-generator/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/designbycode/laravel-business-name-generator.svg?style=flat-square)](https://packagist.org/packages/designbycode/laravel-business-name-generator)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

## Support us

[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/laravel-business-name-generator.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/laravel-business-name-generator)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

## Installation

Expand All @@ -23,39 +14,104 @@ You can install the package via composer:
composer require designbycode/laravel-business-name-generator
```

You can publish and run the migrations with:

```bash
php artisan vendor:publish --tag="laravel-business-name-generator-migrations"
php artisan migrate
This is the contents of the published config file:

```php
return [
];
```

You can publish the config file with:
## Usage
### Basic Usage

```bash
php artisan vendor:publish --tag="laravel-business-name-generator-config"
```php
use Designbycode\LaravelBusinessNameGenerator\Facades\BusinessNameGenerator;
$businessName = BusinessNameGenerator::generate();
```

This is the contents of the published config file:
### Custom Adjectives and Nouns
You can also provide your own lists of adjectives and nouns:

```php
return [
];
```php
$customAdjectives = ["Cool", "Amazing", "Super"];
$customNouns = ["Shop", "Hub", "Center"];

$generator = BusinessNameGenerator::generate($customAdjectives, $customNouns);
echo $businessName; // Example output: "Super Shop"
```

Optionally, you can publish the views using
### Using Specific Categories
You can generate business names based on specific categories of adjectives and nouns:

```bash
php artisan vendor:publish --tag="laravel-business-name-generator-views"
```php
// Generate a business name using playful adjectives and color-related nouns
$businessName = BusinessNameGenerator::generate('playful', 'color');
echo $businessName; // Example output: "Cheerful Blue"
```

## Usage

```php
$businessNameGenerator = new Designbycode\BusinessNameGenerator();
echo $businessNameGenerator->echoPhrase('Hello, Designbycode!');
## Adjective and Noun Categories
### Adjective Categories
- default: Standard business-related adjectives.
- funny: Whimsical and humorous adjectives.
- playful: Light-hearted and playful adjectives.
- color: Color-related adjectives.
- all: A combination of all the above categories.

### Noun Categories
- default: Standard business-related nouns.
- funny: Whimsical and humorous nouns.
- playful: Light-hearted and playful nouns.
- color: Color-related nouns.
- all: A combination of all the above categories.

### Extending the Lists
If you want to extend the list of adjectives or nouns, you can create your own classes that implement the HasGeneratorLists interface.

```php
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"];
}
}

```

Then use your custom class with the BusinessNameGenerator:

```php
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"
````

## Testing

```bash
Expand Down

0 comments on commit b4c7db5

Please sign in to comment.