PHP code example of taylornetwork / username-suggester
1. Go to this page and download the library: Download taylornetwork/username-suggester 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/ */
taylornetwork / username-suggester example snippets
$suggester = new \TaylorNetwork\UsernameSuggester\Suggester();
$suggester->suggest(); // Returns a collection of random unique usernames
$suggester->suggest('test user'); // Returns a collection of unique usernames based on the name 'test user'
namespace App\SuggesterDrivers;
use TaylorNetwork\UsernameSuggester\Drivers\BaseDriver;
class CustomDriver extends BaseDriver
{
public function makeUnique(string $username): string
{
return $username;
}
}