PHPackages                             juststeveking/password-generator - 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. juststeveking/password-generator

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

juststeveking/password-generator
================================

Generate random, memorable passwords easily.

1.0.0(3y ago)23462[1 issues](https://github.com/JustSteveKing/password-generator/issues)MITPHPPHP ^8.1

Since Nov 16Pushed 3y ago3 watchersCompare

[ Source](https://github.com/JustSteveKing/password-generator)[ Packagist](https://packagist.org/packages/juststeveking/password-generator)[ Docs](https://github.com/juststeveking/password-generator)[ RSS](/packages/juststeveking-password-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Password Generator
==================

[](#password-generator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9ca7108cb0b2d28b7c10762eb3a63ade10deb83a885e1d72128863e433573f8b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a75737473746576656b696e672f70617373776f72642d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juststeveking/password-generator)[![Test Suite](https://github.com/juststeveking/password-generator/actions/workflows/tests.yml/badge.svg)](https://github.com/juststeveking/password-generator/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/8edf6cb1e340942accca578942bcb6abee2a8fbbef8367e88e6f25d1eb879969/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a75737473746576656b696e672f70617373776f72642d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juststeveking/password-generator)

**Disclaimer**. This is not intended for use in a production environment to create your passwords. My use case for this is to actually generate one off use codes such as One Time Pass Codes. This is not the most secure as the list of words is quite small, and will leave you open to a potential dictionary attack.

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

[](#installation)

You can install the package via composer:

```
composer require juststeveking/password-generator
```

If you are using Laravel, you can publish the config file with:

```
php artisan vendor:publish --tag="password-generator-config"
```

Set up - Laravel
----------------

[](#set-up---laravel)

To set this package up, you can replace the words within the config file with those of your own choosing. Then you are ready to go.

Usage
-----

[](#usage)

### Using the Facade in Laravel

[](#using-the-facade-in-laravel)

Call the facade directly to resolve the Password Generator from the container and call the static methods.

```
use JustSteveKing\PasswordGenerator\Facades\Generator;

// Generate a standard password
$password = Generator::generate(); // example 'strong-car-fast-snail'

// Generate a "secure" password
$password = Generator::generateSecure(); // example 'str0ng-c4r-f4st-sn41l'
```

### Without the Facade in Laravel

[](#without-the-facade-in-laravel)

Inject the contract into the constructor, and call either "generate" or "generateSecure" depending on your use case.

```
use JustSteveKing\PasswordGenerator\Contracts\GeneratorContract;
use Illuminate\Http\JsonResponse;

class GeneratePasswordController
{
    public function __construct(
        private readonly GeneratorContract $generator,
    ) {}

    public function __invoke(): JsonResponse
    {
        return new JsonResponse(
            data: [
                'password' => $this->generator->generate(), // or generateSecure() for "secure" passwords.
            ],
        );
    }
}
```

### Using outside of Laravel

[](#using-outside-of-laravel)

If you have a DI container all you will need to do is resolve the class using the instance. Be mindful that you will need to set up your own container instructions and load in your own words list.

```
// Once you have added this to your container, and injected
$password = $this->generator->generate();

// Or like the Laravel implementation, generate a secure password
$password = $this->generator->generateSecure();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Steve McDougall](https://github.com/juststeveking)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1271d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a87fe82b349821ebd49cf57d65c4cd3e33ae0833222a8438d90fe8921ca899ea?d=identicon)[JustSteveKing](/maintainers/JustSteveKing)

---

Top Contributors

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

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/juststeveking-password-generator/health.svg)

```
[![Health](https://phpackages.com/badges/juststeveking-password-generator/health.svg)](https://phpackages.com/packages/juststeveking-password-generator)
```

###  Alternatives

[guava/calendar

Adds support for vkurko/calendar to Filament PHP.

298241.0k3](/packages/guava-calendar)[tonysm/rich-text-laravel

Integrates Trix content with Laravel

46577.8k1](/packages/tonysm-rich-text-laravel)[mauricius/laravel-htmx

Laravel helper library for Htmx

364101.1k1](/packages/mauricius-laravel-htmx)[illuminate/reflection

The Illuminate Reflection package.

361.6M3](/packages/illuminate-reflection)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[spatie/laravel-screenshot

Take screenshots of web pages in Laravel apps

7615.9k2](/packages/spatie-laravel-screenshot)

PHPackages © 2026

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