承接 jorenvanhocht/hashify 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jorenvanhocht/hashify

Composer 安装命令:

composer require jorenvanhocht/hashify

包简介

Quickly create a (database unique) string.

README 文档

README

This Laravel package makes it easy to generate random strings from a given charset. It can also generate database table and/or column unique strings.

Installation

This package can be installed through Composer.

composer require jorenvanhocht/hashify

You must register the service provider.

// config/app.php
'provider' => [
    ...
    jorenvanhocht\Hashify\Providers\HashifyServiceProvider::class,
    ...
];

This package also comes with a facade, which provides an easy way to call the class.

// config/app.php
'aliases' => [
    ...
    'Hashify'    => jorenvanhocht\Hashify\Facades\Hashify::class,
    ...
];

You can publish the config file of this package with this command:

php artisan vendor:publish --provider="jorenvanhocht\Hashify\HashifyServiceProvider"

The following config file will be published in config/hashify.php

<?php

return [
    'charsets' => [
        'database' => 'ABCDEFGHIJKLMNOPQRSTUVWabcdefghijklmnopqrstuvw0123456789',
    ],
];

Usage

private $hashify;
public function __construct(Hashify $hashify)
{
	$this->hashify = $hashify;
}

public function myMethod()
{
	// random string
	echo $this->hashify->make($minLength, $maxLength);

	// database unique random string
	echo $this->hashify->make()->unqique('users');
	echo $this->hashify->make()->unqique('users', 'colName');
	echo $this->hashify->make(2, 10)->unqique('users', 'colName');
}

To do

The usage of different char sets.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固