gabrielesbaiz/password-toolkit 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gabrielesbaiz/password-toolkit

最新稳定版本:1.4.0

Composer 安装命令:

composer require gabrielesbaiz/password-toolkit

包简介

A lightweight helper package to generate nice passwords.

README 文档

README

Latest Version on Packagist Total Downloads

A lightweight helper package to generate nice passwords.

Features

  • ✅ Password generator
  • ✅ Name + adjective password style
  • ✅ Higly customizable
  • ✅ Works seamlessly with Laravel facades

Installation

You can install the package via composer:

composer require gabrielesbaiz/password-toolkit

You can publish the config file with:

php artisan vendor:publish --tag="password-toolkit-config"

This is the contents of the published config file:

return [
    /*
     * Configuration for name types for people and things to be used
     */
    'name_types' => [
        'people' => [
            'back_to_the_future' => true,
            'cartoons' => true,
            'game_of_thrones' => true,
            'harry_potter' => true,
            'italian_actors' => true,
            'italian_basketball_legends' => true,
            'italian_comedians' => true,
            'italian_nobel_prize_winners' => true,
            'italian_presidents_of_the_republic' => true,
            'italian_television_personalities' => true,
            'italian_writers' => true,
            'philosophers' => true,
            'star_wars' => true,
        ],
        'things' => [
            'car_brands' => true,
            'italian_cheeses' => true,
            'italian_monuments' => true,
            'italian_regional_foods' => true,
            'italian_wines' => true,
            'coffee_brands' => true,
        ],
    ],

    /*
     * Defines the symbol used to separate words in the generated password.
     *
     * Can be any symbol or null if no separator is desired.
     */
    'separator_symbol' => '-',

    /*
     * Defines whether to replace spaces with the separator
     * symbol in the name part of the password.
     *
     * Options:
     * 'true' will replace spaces with the separator symbol
     * 'false' will remove spaces.
     */
    'name_separator' => true,

    /*
     * Determines if numbers should be added to the generated password.
     *
     * Options:
     * 'true' will add numbers
     * 'false' will not
     */
    'add_numbers' => true,

    /*
     * Specifies the number of digits for the random number
     * that will be added to the password (if enabled).
     */
    'numbers_digits' => 4,

    /*
     * Defines where to place the numbers in the password.
     *
     * Options:
     * 'start' - numbers are placed at the beginning of the password,
     * 'middle' - numbers are placed in the middle of the password,
     * 'end' - numbers are placed at the end of the password.
     */
    'numbers_position' => 'end',

    /*
     * Defines the level of leetspeak conversion to apply
     * to the generated password.
     *
     * Options:
     * 'no' - no leetspeak conversion,
     * 'basic' - apply basic leetspeak conversion,
     * 'advanced' - apply advanced leetspeak conversion.
     */
    'leetspeak_conversion' => 'no',
];

Usage

$passwordToolkit = new Gabrielesbaiz\PasswordToolkit();

echo $passwordToolkit->generate();

Using facade:

use PasswordToolkit;

PasswordToolkit::generate();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 957
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-02