PHPackages                             techtailor/rpg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. techtailor/rpg

ActiveLaravel[Utility &amp; Helpers](/categories/utility)

techtailor/rpg
==============

Random Password Generator for Laravel

v1.0.4(8y ago)563.4k↑27.7%2[1 issues](https://github.com/TechTailor/RPG/issues)MITPHP

Since Jan 31Pushed 1y ago2 watchersCompare

[ Source](https://github.com/TechTailor/RPG)[ Packagist](https://packagist.org/packages/techtailor/rpg)[ RSS](/packages/techtailor-rpg/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)DependenciesVersions (10)Used By (0)

[![](https://camo.githubusercontent.com/5fd744253ea5e616f3838d0f1ef0af281ad978f1b3c88b887240e724e6438fb7/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f52616e646f6d25323050617373776f726425323047656e657261746f722e706e673f7468656d653d6c69676874267061636b6167654e616d653d546563685461696c6f72253246525047267061747465726e3d746f706f677261706879267374796c653d7374796c655f32266465736372697074696f6e3d47656e65726174652b72616e646f6d2b636f6e666967757261626c652b737472696e67732b746f2b62652b757365642b61732b70617373776f7264732e266d643d3126666f6e7453697a653d313030707826696d616765733d6c6f636b2d636c6f736564)](https://camo.githubusercontent.com/5fd744253ea5e616f3838d0f1ef0af281ad978f1b3c88b887240e724e6438fb7/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f52616e646f6d25323050617373776f726425323047656e657261746f722e706e673f7468656d653d6c69676874267061636b6167654e616d653d546563685461696c6f72253246525047267061747465726e3d746f706f677261706879267374796c653d7374796c655f32266465736372697074696f6e3d47656e65726174652b72616e646f6d2b636f6e666967757261626c652b737472696e67732b746f2b62652b757365642b61732b70617373776f7264732e266d643d3126666f6e7453697a653d313030707826696d616765733d6c6f636b2d636c6f736564)

[![GitHub release](https://camo.githubusercontent.com/2b3665a4a317b2345ef42409d6cb9eb1646d8f3d1d42fb51d285e23c4dc92773/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f746563687461696c6f722f7270672e7376673f7374796c653d666f722d7468652d62616467652626636f6c6f72423d374535374332)](https://packagist.org/packages/techtailor/rpg)[![GitHub issues](https://camo.githubusercontent.com/da69dd33a8c467babec60b02ad4f8fdcd69fc5ba1592e97993ca7f9c6ee01698/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f546563685461696c6f722f5250472e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/TechTailor/RPG/issues)[![](https://camo.githubusercontent.com/3848cc7d484d129b34e0ba7085612aaf2dc2a8f79c028923c9f11e96ee3949bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374796c6543492d7061737365642d677265656e2e7376673f7374796c653d666f722d7468652d62616467652626636f6c6f72423d464636394234)](https://camo.githubusercontent.com/3848cc7d484d129b34e0ba7085612aaf2dc2a8f79c028923c9f11e96ee3949bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374796c6543492d7061737365642d677265656e2e7376673f7374796c653d666f722d7468652d62616467652626636f6c6f72423d464636394234)[![Software License](https://camo.githubusercontent.com/c003d4d48be8c870b7f5dfef6e898cc00ece72e12064c1eb199611b0e290ce92/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666f722d7468652d62616467652626636f6c6f72423d463237453430)](license.md)[![Total Downloads](https://camo.githubusercontent.com/40962b63eae4e14efd4183ffa2ff2afd8319eb5f0c1e016ce2d7ae942d5ec09e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746563687461696c6f722f7270672e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/techtailor/rpg)[![Twitter](https://camo.githubusercontent.com/6826b53714f8a7b56a645e2e26f428437618a374c209cf6d750f67bfa60efe73/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f546563685461696c6f722f5250472e7376673f7374796c653d736f6369616c)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FTechTailor%2FRPG)

This package is a simple Laravel untility that allows you to generate complex passwords using a simple Facade.

Installation
------------

[](#installation)

### Step 1: Install Through Composer

[](#step-1-install-through-composer)

```
$ composer require techtailor/rpg
```

### Step 2: Add the Service Provider (Skip this step for Laravel 5.5 or higher)

[](#step-2-add-the-service-provider-skip-this-step-for-laravel-55-or-higher)

In the 'config/app.php' file -

```
'providers' => [
    // ...
    TechTailor\RPG\RPGServiceProvider::class,
];
```

### Step 3: Add the Alias (Skip this step for Laravel 5.5 or higher)

[](#step-3-add-the-alias-skip-this-step-for-laravel-55-or-higher)

In the 'config/app.php' file -

```
'aliases' => [
    // ...
    'RPG' => TechTailor\RPG\Facade\RPG::class,
];
```

In Laravel 5.5 &amp; higher the package will autoregister the service provider and the alias.

Usage
-----

[](#usage)

In order to use the included RPG Facade, import the following in your file

```
use TechTailor\RPG\Facade\RPG;
```

### The RPG Facade comes with three basic methods - `Generate`, `Preset` and `Decrypt`

[](#the-rpg-facade-comes-with-three-basic-methods---generate-preset-and-decrypt)

The `Generate` method allows you to pass custom specifications for the generator.

```
 RPG::Generate($character, $size, $dashes, $encrypt);
```

Lets go into a bit detail about each of the specifications that can be provided

```
$character
//Accepts a string of letters called "luds"
//Where > l is for lowercase alphabets
        > u is for uppercase alphabets
        > d is for digits
        > s is for special characters'
//The combination of these letters will provide the character set for the generator. Ex: 'ld' will only generate string with lowercase alphabets and digits.
```

```
$size
//The total size/lenght of the string your want to generate.
//Ex : 15 - will generate a string of total 15 characters using the character set your selected
```

```
$dashes (defaults to 0)
//Two options - 0 or 1
//Using '1' - will add multiple dashes (-) randomly within the string generated.
```

```
$encrypt (defaults to 0)
//Two options - 0 or 1
//Using '1' - will return you an encrypted version of the password. Can be decrypted using RPG::Decrypt.
```

Example command for generating a password string of 16 characters with dashes using the 'lud (lowercase, uppercase, digits)' character set -

```
return RPG::Generate('lud',16,1); //Result: 37vX-zerT-weSa-vCC3
```

Example command for generating an encrypted password string of 16 characters with dashes using the 'lud (lowercase, uppercase, digits)' character set -

```
return RPG::Generate('lud',16,1,1);

//Result: eyJpdiI6IjdTK3ZmMGZXNXl2a2xQSU1sNVhKZEE9PSIsInZhbHVlIjoiK1NxcTdUbVF3Q2dqSGVcL0JFKzRHR3VWNm5NWUdUNDY0dEFnOFN0S2JDdVk9IiwibWFjIjoiODEwMjIwOTBiNjBiOWRhMjJlNTliNGY0NzEyNDFjNmJkODIwZmFhMjMyY2IzOThkMzRmMTcyZGZkMjk1ZmUwYiJ9
```

The `Preset` method allows you to instantly select from any of the 4 preset specifications for the generator. You can also ad the encrypt modifier to the Preset method aswell for returning an encrypted Preset String.

```
 RPG::Preset($preset); //Where $preset value can be 1, 2, 3 or 4.
 or
 RPG::Preset($preset,1); // For encrypting the result before returning it.
```

Details of each preset -

```
 Preset - 1
 //Character Set = 'ld' //Size = 8  //Dashes = 0 (Dashes Not allowed)
 //Sample Result: cn3hvphy
 Preset - 2
 //Character Set = 'lud' //Size = 8  //Dashes = 0 (Dashes Not allowed)
 //Sample Result: 4sCFwNr8
 Preset - 3
 //Character Set = 'luds' //Size = 12  //Dashes = 0 (Dashes Not allowed)
 //Sample Result: r&$EQx1#USbw
 Preset - 4
 //Character Set = 'luds' //Size = 16  //Dashes = 1 (Dashes Allowed)
 //Sample Result: 1Z2h-F&?C-x$Tg-KEA8
 Preset - 5
 //Character Set = 'luds' //Size = 32  //Dashes = 1 (Dashes Allowed)
 //Sample Result: 1Z2h-F&?C-x$Tg-KEA8-a2E3-E$#e-@#we-12@2
```

The `Decrypt` method allows you to decrypt any string/password encrypted by passing the encrypt modifier to the Generate or Preset method. Note : Only passwords encrypted by your laravel app can be decrypted.

```
 return RPG::Decrypt($encrypted);
```

### Important Note

[](#important-note)

The passwords are encrypted using the Laravel App Key (which can be found in your .env file). If you change/modify your Laravel App Key, you will no longer be able to decrypt any previously encrypted strings.

Well that should be enough to get you up and running in no time.

Demo Site
---------

[](#demo-site)

You can check out the live demo of this package at [rpg.gits.moinuddin.dev](https://rpg.gits.moinuddin.dev)

Changelog
---------

[](#changelog)

Please see [CHANGELOG](changelog.md) for more information what has changed recently.

TODO
----

[](#todo)

List of features or additional functionality we are working on (in no particular order) -

```
Nothing on the TODO List.
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](contributing.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](license.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

8

Last Release

2999d ago

Major Versions

v0.1.2 → v1.0.02018-01-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/43e6cf99484811318d85197b26917de306406af2b4e8f418360724556c4d0f0b?d=identicon)[TechTailor](/maintainers/TechTailor)

---

Top Contributors

[![TechTailor](https://avatars.githubusercontent.com/u/14147474?v=4)](https://github.com/TechTailor "TechTailor (5 commits)")

---

Tags

hacktoberfestlaravellaravel-10-packagelaravel-5-packagelaravel-6-packagelaravel-7-packagelaravel-9-packagelaravel55password-generatorphprandom-generationrandom-passwordrandom-password-generatorrandom-string-generatorrpgrpg-facadestring-generator

### Embed Badge

![Health badge](/badges/techtailor-rpg/health.svg)

```
[![Health](https://phpackages.com/badges/techtailor-rpg/health.svg)](https://phpackages.com/packages/techtailor-rpg)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
