From b4c7db52854bb10cce4c15a0a5cd4945d0b33d25 Mon Sep 17 00:00:00 2001 From: designbycode Date: Sat, 8 Jun 2024 19:53:37 +0200 Subject: [PATCH] Update readme --- README.md | 112 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 84 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 022dd71..a71759e 100644 --- a/README.md +++ b/README.md @@ -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 - -[](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 @@ -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