Download the PHP package taylornetwork/username-suggester without Composer

On this page you can find all versions of the php package taylornetwork/username-suggester. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package username-suggester

Username Suggester

A package to suggest usernames from taylornetwork/laravel-username-generator

This would be useful if you want to show your users a list of suggested usernames based on their entry if their selection is unavailable.

Install

Via composer

Publish Config

This will publish to config/username_suggester.php

Set Up

You will need to follow the quickstart guide for taylornetwork/laravel-username-generator.

At minimum your User model needs to use the TaylorNetwork\UsernameGenerator\FindSimilarUsernames (see set up)

Defaults

The suggester will generate 3 unique usernames based on the given name. It will use the increment driver which will use the TaylorNetwork\UsernameGenerator\Generator class to convert the name to a username and then add incrementing numbers on the end to make them unique.

If no name is entered it will generate random usernames, same as TaylorNetwork\UsernameGenerator\Generator

Usage

Available Methods

suggest

The suggest() method accepts an optional parameter of the name to suggest usernames for.

setDriver

This will allow you to set a different driver than the default.

This method returns an instance of the Suggester class, so you're able to chain methods.

setAmount

This will allow you to set a different amount of suggestions than the default.

This method returns an instance of the Suggester class, so you're able to chain methods.

setGeneratorConfig

This will allow you to override the TaylorNetwork\UsernameGenerator\Generator config.

Same as setAmount and setDriver this method also returns the Suggester instance.

Example

Basic with Random Usernames

Basic with Entered Name

Different Driver and Amount

This will use the Random driver to append random numbers after the username and generate 5 usernames.

Using the Facade

A UsernameSuggester facade is included so all the methods can be accessed that way.

Custom Drivers

You can create any custom drivers by extending the TaylorNetwork\UsernameSuggester\Drivers\BaseDriver class.

The only requirement is that you implement the makeUnique method to make the username unique in some way.

You'll also need to register the driver in app/username_suggester.php

You can access it using the key you set.


All versions of username-suggester with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1
illuminate/support Version >=8.0
taylornetwork/laravel-username-generator Version ^2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package taylornetwork/username-suggester contains the following files

Loading the files please wait ....